soc: qcom: Use of_property_present() for testing DT property presence
Subsystems (2)
PATCH 1/1 soc: qcom: Use of_property_present() for testing DT property presence
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. As part of this, convert of_get_property/of_find_property calls to the recently added of_property_present() helper when we just want to test for presence of a property and nothing more.
--- drivers/soc/qcom/qcom_aoss.c | 2 +- drivers/soc/qcom/smem.c | 2 +- drivers/soc/qcom/smsm.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/soc/qcom/qcom_aoss.c +1 -1
@@ -395,7 +395,7 @@ static int qmp_cooling_devices_register(struct qmp *qmp)return -ENOMEM ;for_each_available_child_of_node (np, child) { -if (!of_find_property (child,"#cooling-cells" ,NULL )) +if (!of_property_present (child,"#cooling-cells" ))continue ; ret =qmp_cooling_device_add (qmp, &qmp->cooling_devs[count++], child);
drivers/soc/qcom/smem.c +1 -1
@@ -1045,7 +1045,7 @@ static int qcom_smem_probe(struct platform_device *pdev)int i; num_regions =1 ; -if (of_find_property (pdev->dev.of_node,"qcom,rpm-msg-ram" ,NULL )) +if (of_property_present (pdev->dev.of_node,"qcom,rpm-msg-ram" )) num_regions++; array_size = num_regions *sizeof (struct smem_region );
drivers/soc/qcom/smsm.c +1 -1
@@ -510,7 +510,7 @@ static int qcom_smsm_probe(struct platform_device *pdev)return -ENOMEM ;for_each_child_of_node (pdev->dev.of_node, local_node) { -if (of_find_property (local_node,"#qcom,smem-state-cells" ,NULL )) +if (of_property_present (local_node,"#qcom,smem-state-cells" ))break ; }if (!local_node) {
Signature · 1 line
2.39.2
Quoted 9 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. As part of this, convert of_get_property/of_find_property calls to the recently added
of_property_present()helper when we just want to test for presence of a property and nothing more.Signed-off-by Rob Herring <[email protected]>---
Konrad
Quoted 44 lines
drivers/soc/qcom/qcom_aoss.c | 2 +- drivers/soc/qcom/smem.c | 2 +- drivers/soc/qcom/smsm.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)drivers/soc/qcom/qcom_aoss.c +1
-1@@ -395,7 +395,7 @@ static int qmp_cooling_devices_register(struct qmp *qmp)return -ENOMEM ;for_each_available_child_of_node (np, child) { -if (!of_find_property (child,"#cooling-cells" ,NULL )) +if (!of_property_present (child,"#cooling-cells" ))continue ; ret =qmp_cooling_device_add (qmp, &qmp->cooling_devs[count++], child);drivers/soc/qcom/smem.c +1
-1@@ -1045,7 +1045,7 @@ static int qcom_smem_probe(struct platform_device *pdev)int i; num_regions =1 ; -if (of_find_property (pdev->dev.of_node,"qcom,rpm-msg-ram" ,NULL )) +if (of_property_present (pdev->dev.of_node,"qcom,rpm-msg-ram" )) num_regions++; array_size = num_regions *sizeof (struct smem_region );drivers/soc/qcom/smsm.c +1
-1@@ -510,7 +510,7 @@ static int qcom_smsm_probe(struct platform_device *pdev)return -ENOMEM ;for_each_child_of_node (pdev->dev.of_node, local_node) { -if (of_find_property (local_node,"#qcom,smem-state-cells" ,NULL )) +if (of_property_present (local_node,"#qcom,smem-state-cells" ))break ; }if (!local_node) {
Quoted 8 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. As part of this, convert of_get_property/of_find_property calls to the recently added
of_property_present()helper when we just want to test for presence of a property and nothing more.[...]
Applied, thanks!
[1/1] soc: qcom: Use of_property_present() for testing DT property presence
commit: 4a1b9f4eb122f3e36fdfe62dce96091d3e45132f
Best regards,
Signature · 1 line
Bjorn Andersson <[email protected]>