[PATCH v2] PCI: iproc: Use of_property_read_bool() for boolean properties

Rob Herring posted 1 patch 2 years, 8 months ago
drivers/pci/controller/pcie-iproc-msi.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
[PATCH v2] PCI: iproc: Use of_property_read_bool() for boolean properties
Posted by Rob Herring 2 years, 8 months ago
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 of_property_read_bool().

Signed-off-by: Rob Herring <robh@kernel.org>
---
v2:
 - Commit msg: s/to to/to/
---
 drivers/pci/controller/pcie-iproc-msi.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/controller/pcie-iproc-msi.c b/drivers/pci/controller/pcie-iproc-msi.c
index fee036b07cd4..649fcb449f34 100644
--- a/drivers/pci/controller/pcie-iproc-msi.c
+++ b/drivers/pci/controller/pcie-iproc-msi.c
@@ -525,7 +525,7 @@ int iproc_msi_init(struct iproc_pcie *pcie, struct device_node *node)
 	if (!of_device_is_compatible(node, "brcm,iproc-msi"))
 		return -ENODEV;
 
-	if (!of_find_property(node, "msi-controller", NULL))
+	if (!of_property_read_bool(node, "msi-controller"))
 		return -ENODEV;
 
 	if (pcie->msi)
@@ -585,8 +585,7 @@ int iproc_msi_init(struct iproc_pcie *pcie, struct device_node *node)
 		return -EINVAL;
 	}
 
-	if (of_find_property(node, "brcm,pcie-msi-inten", NULL))
-		msi->has_inten_reg = true;
+	msi->has_inten_reg = of_property_read_bool(node, "brcm,pcie-msi-inten");
 
 	msi->nr_msi_vecs = msi->nr_irqs * EQ_LEN;
 	msi->bitmap = devm_bitmap_zalloc(pcie->dev, msi->nr_msi_vecs,
-- 
2.39.2
Re: [PATCH v2] PCI: iproc: Use of_property_read_bool() for boolean properties
Posted by Krzysztof Wilczyński 2 years, 7 months ago
Hello,

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

Applied to controller/iproc, thank you!

[1/1] PCI: iproc: Use of_property_read_bool() for boolean properties
      https://git.kernel.org/pci/pci/c/4ce7d88e7ad9

	Krzysztof
Re: [PATCH v2] PCI: iproc: Use of_property_read_bool() for boolean properties
Posted by Ray Jui 2 years, 7 months ago

On 6/9/2023 12:33 PM, Rob Herring wrote:
> 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 of_property_read_bool().
> 
> Signed-off-by: Rob Herring <robh@kernel.org>

Acked-by: Ray Jui <ray.jui@broadcom.com>

Thanks!
Re: [PATCH v2] PCI: iproc: Use of_property_read_bool() for boolean properties
Posted by Florian Fainelli 2 years, 8 months ago
On 6/9/23 12:33, Rob Herring wrote:
> 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 of_property_read_bool().
> 
> Signed-off-by: Rob Herring <robh@kernel.org>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
-- 
Florian