Skip to contentSkip to conversation

PCI: dwc: Use of_property_present() for non-boolean properties

PATCH Applied Rob Herring (Arm) 3 participants 4 messages Nov 4, 2024 – Nov 16, 2024

Subsystems (3)
lore
Share & tools
lore

Rob Herring (Arm)

author reviewer
#0 lore raw

PATCH 1/1 PCI: dwc: Use of_property_present() for non-boolean properties

The use of of_property_read_bool() for non-boolean properties is deprecated in favor of of_property_present() when testing for property presence.

---
 drivers/pci/controller/dwc/pcie-designware-host.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/controller/dwc/pcie-designware-host.c +2 -2
index 3e41865c7290..d2291c3ceb8b 100644
@@ -474,8 +474,8 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp)
 
 	if (pci_msi_enabled()) {
 		pp->has_msi_ctrl = !(pp->ops->msi_init ||
-				     of_property_read_bool(np, "msi-parent") ||
-				     of_property_read_bool(np, "msi-map"));
+				     of_property_present(np, "msi-parent") ||
+				     of_property_present(np, "msi-map"));
 
 		/*
 		 * For the has_msi_ctrl case the default assignment is handled
Signature · 1 line
2.45.2
#1 lore raw

Hello,

Quoted 3 lines

The use of of_property_read_bool() for non-boolean properties is deprecated in favor of of_property_present() when testing for property presence.

Applied to controller/dwc, thank you!

[01/01] PCI: dwc: Use of_property_present() for non-boolean properties

        https://git.kernel.org/pci/pci/c/6734997ebd6e

	Krzysztof
Acked-by on v1 1/1
#2 lore raw
In reply to Rob Herring (Arm)
Quoted 5 lines · Rob Herring (Arm)

The use of of_property_read_bool() for non-boolean properties is deprecated in favor of of_property_present() when testing for property presence.

- Mani

Quoted 22 lines
---
 drivers/pci/controller/dwc/pcie-designware-host.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/controller/dwc/pcie-designware-host.c +2 -2
index 3e41865c7290..d2291c3ceb8b 100644
@@ -474,8 +474,8 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp)
 
 	if (pci_msi_enabled()) {
 		pp->has_msi_ctrl = !(pp->ops->msi_init ||
-				     of_property_read_bool(np, "msi-parent") ||
-				     of_property_read_bool(np, "msi-map"));
+				     of_property_present(np, "msi-parent") ||
+				     of_property_present(np, "msi-map"));
 
 		/*
 		 * For the has_msi_ctrl case the default assignment is handled
Signature · 1 line
2.45.2
Signature · 1 line
மணிவண்ணன் சதாசிவம்