Skip to content

Commit

Permalink
mailbox: Use of_property_read_bool() for boolean properties
Browse files Browse the repository at this point in the history
It is preferred to use typed property access functions (i.e.
of_property_read_<type> functions) rather than low-level
of_get_property/of_find_property functions for reading properties.
Convert reading boolean properties to to of_property_read_bool().

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
  • Loading branch information
robherring authored and JassiBrar committed Apr 18, 2023
1 parent 76d4ada commit 2a61e7b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 1 addition & 4 deletions drivers/mailbox/hi6220-mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,7 @@ static int hi6220_mbox_probe(struct platform_device *pdev)
writel(~0x0, ACK_INT_CLR_REG(mbox->ipc));

/* use interrupt for tx's ack */
if (of_find_property(node, "hi6220,mbox-tx-noirq", NULL))
mbox->tx_irq_mode = false;
else
mbox->tx_irq_mode = true;
mbox->tx_irq_mode = !of_property_read_bool(node, "hi6220,mbox-tx-noirq");

if (mbox->tx_irq_mode)
mbox->controller.txdone_irq = true;
Expand Down
3 changes: 1 addition & 2 deletions drivers/mailbox/omap-mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,7 @@ static int omap_mbox_probe(struct platform_device *pdev)

finfo->name = child->name;

if (of_find_property(child, "ti,mbox-send-noirq", NULL))
finfo->send_no_irq = true;
finfo->send_no_irq = of_property_read_bool(child, "ti,mbox-send-noirq");

if (finfo->tx_id >= num_fifos || finfo->rx_id >= num_fifos ||
finfo->tx_usr >= num_users || finfo->rx_usr >= num_users)
Expand Down

0 comments on commit 2a61e7b

Please sign in to comment.