Skip to contentSkip to conversation

mailbox: Use of_property_read_bool() for boolean properties

PATCH In review Rob Herring 2 participants 5 messages Mar 10, 2023 – Apr 18, 2023 Mailbox API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mailbox: Use of_property_read_bool() for boolean properties

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().

---
 drivers/mailbox/hi6220-mailbox.c | 5 +----
 drivers/mailbox/omap-mailbox.c   | 3 +--
 2 files changed, 2 insertions(+), 6 deletions(-)
drivers/mailbox/hi6220-mailbox.c +1 -4
index fca61f5312d9..1c73c63598f5 100644
@@ -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;
drivers/mailbox/omap-mailbox.c +1 -2
index 098c82d87137..fd28ac2120df 100644
@@ -763,8 +763,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)
Signature · 1 line
2.39.2
#1 lore raw
Quoted 10 lines · Rob Herring

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().

---
 drivers/mailbox/hi6220-mailbox.c | 5 +----
 drivers/mailbox/omap-mailbox.c   | 3 +--
 2 files changed, 2 insertions(+), 6 deletions(-)

Ping!

Quoted 34 lines
drivers/mailbox/hi6220-mailbox.c +1 -4
index fca61f5312d9..1c73c63598f5 100644
@@ -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;
drivers/mailbox/omap-mailbox.c +1 -2
index 098c82d87137..fd28ac2120df 100644
@@ -763,8 +763,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)
Signature · 1 line
2.39.2
maintainer
#2 lore raw
Quoted 7 lines · Rob Herring
Quoted 5 lines · Rob Herring

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().

Quoted 8 lines
Quoted 5 lines
---
 drivers/mailbox/hi6220-mailbox.c | 5 +----
 drivers/mailbox/omap-mailbox.c   | 3 +--
 2 files changed, 2 insertions(+), 6 deletions(-)

Ping!

Pong :)

I don't usually reply back that it looks good and will pick for the merge window. I just do that. So yes, it is not overlooked.

cheers

#3 lore raw
Quoted 15 lines · Jassi Brar
Quoted 13 lines · Rob Herring
Quoted 10 lines · Rob Herring

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().

---
 drivers/mailbox/hi6220-mailbox.c | 5 +----
 drivers/mailbox/omap-mailbox.c   | 3 +--
 2 files changed, 2 insertions(+), 6 deletions(-)
Quoted 6 lines
Quoted 2 lines

Ping!

Pong :)

I don't usually reply back that it looks good and will pick for the merge window. I just do that. So yes, it is not overlooked.

Okay. No reply nor applying it in over a month is not a great experience for submitters.

Rob

maintainer
#4 lore raw
Quoted 19 lines · Rob Herring
Quoted 17 lines · Jassi Brar
Quoted 15 lines · Rob Herring
Quoted 10 lines · Rob Herring

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().

---
 drivers/mailbox/hi6220-mailbox.c | 5 +----
 drivers/mailbox/omap-mailbox.c   | 3 +--
 2 files changed, 2 insertions(+), 6 deletions(-)

Ping!

Quoted 8 lines
Quoted 4 lines

Pong :)

I don't usually reply back that it looks good and will pick for the merge window. I just do that. So yes, it is not overlooked.

Okay. No reply nor applying it in over a month is not a great experience for submitters.

I sense that. I may be wrong, but I feel any form of ack from a maintainer demotivates others from looking critically at the submission. I have seen revisions asked after many weeks of submission. So my idea is to let a patch roast in public glare. Maybe I should reply after 2-3weeks.

-j