Skip to contentSkip to conversation

iommu: omap: Use of_property_read_bool() for boolean properties

PATCH In review Rob Herring 3 participants 3 messages Mar 10, 2023 – Mar 22, 2023 IOMMU

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu: omap: 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/iommu/omap-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/omap-iommu.c +1 -1
index 3ab078112a7c..baafd6211ac4 100644
@@ -1191,7 +1191,7 @@ static int omap_iommu_probe(struct platform_device *pdev)
 		return err;
 	if (obj->nr_tlb_entries != 32 && obj->nr_tlb_entries != 8)
 		return -EINVAL;
-	if (of_find_property(of, "ti,iommu-bus-err-back", NULL))
+	if (of_property_read_bool(of, "ti,iommu-bus-err-back"))
 		obj->has_bus_err_back = MMU_GP_REG_BUS_ERR_BACK_EN;
 
 	obj->dev = &pdev->dev;
Signature · 1 line
2.39.2
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 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 18 lines
---
  drivers/iommu/omap-iommu.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/omap-iommu.c +1 -1
index 3ab078112a7c..baafd6211ac4 100644
@@ -1191,7 +1191,7 @@ static int omap_iommu_probe(struct platform_device *pdev)
  		return err;
  	if (obj->nr_tlb_entries != 32 && obj->nr_tlb_entries != 8)
  		return -EINVAL;
-	if (of_find_property(of, "ti,iommu-bus-err-back", NULL))
+	if (of_property_read_bool(of, "ti,iommu-bus-err-back"))
  		obj->has_bus_err_back = MMU_GP_REG_BUS_ERR_BACK_EN;
 
  	obj->dev = &pdev->dev;
maintainer
#2 lore raw
In reply to Rob Herring
Quoted 2 lines · Rob Herring
 drivers/iommu/omap-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied with minor style fixes in the commit message.