Skip to contentSkip to conversation

usb: xhci: tegra: Fix OF boolean read warning

PATCH In review Jon Hunter 2 participants 2 messages Jan 16, 2025 – Jan 17, 2025

Subsystems (3)
lore
Share & tools
lore

Jon Hunter

author maintainer
#0 lore raw

PATCH 1/1 usb: xhci: tegra: Fix OF boolean read warning

After commit c141ecc3cecd ("of: Warn when of_property_read_bool() is used on non-boolean properties") was added, the following warning is observed for the Tegra XHCI driver ...

OF: /bus@0/usb@3610000: Read of boolean property 'power-domains' with
a value.

Previously, of_property_read_bool() was used to determine if a property was present but has now been replaced by of_property_present(). The warning is meant to prevent new users but this user existed before the change was made. Fix this by updating the Tegra XHCI driver to use of_property_present() function to determine if the 'power-domains' property is present.

Fixes c141ecc3cecd ("of: Warn when of_property_read_bool() is used on non-boolean properties")
---
 drivers/usb/host/xhci-tegra.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/xhci-tegra.c +1 -1
index 06ae193ec874..7ac341b3599a 100644
@@ -1667,7 +1667,7 @@ static int tegra_xusb_probe(struct platform_device *pdev)
 		goto put_padctl;
 	}
 
-	if (!of_property_read_bool(pdev->dev.of_node, "power-domains")) {
+	if (!of_property_present(pdev->dev.of_node, "power-domains")) {
 		tegra->host_rst = devm_reset_control_get(&pdev->dev,
 							 "xusb_host");
 		if (IS_ERR(tegra->host_rst)) {
Signature · 1 line
2.43.0
Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines · Jon Hunter

After commit c141ecc3cecd ("of: Warn when of_property_read_bool() is used on non-boolean properties") was added, the following warning is observed for the Tegra XHCI driver ...

OF: /bus@0/usb@3610000: Read of boolean property 'power-domains' with
a value.

Previously, of_property_read_bool() was used to determine if a property was present but has now been replaced by of_property_present(). The warning is meant to prevent new users but this user existed before the change was made. Fix this by updating the Tegra XHCI driver to use of_property_present() function to determine if the 'power-domains' property is present.

Quoted 5 lines
Fixes c141ecc3cecd ("of: Warn when of_property_read_bool() is used on non-boolean properties")
---
 drivers/usb/host/xhci-tegra.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)