Skip to contentSkip to conversation

remoteproc: Use presence checks for syscon props

PATCH Applied Rob Herring (Arm) 2 participants 3 messages Jun 12 – Jun 29 Remote processor (remoteproc)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remoteproc: Use presence checks for syscon props

The OMAP and Keystone remoteproc drivers only need to know whether "ti,bootreg" and "ti,syscon-dev" are present before parsing them. Reading those properties as booleans misrepresents their DT encoding.

Use of_property_present() for the presence tests and keep the existing phandle parsing for the actual property values.

Assisted-by Codex:gpt-5-5
---
 drivers/remoteproc/keystone_remoteproc.c | 2 +-
 drivers/remoteproc/omap_remoteproc.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/remoteproc/keystone_remoteproc.c +1 -1
index e7fde5509786..83763d640c4e 100644
@@ -317,7 +317,7 @@ static int keystone_rproc_of_get_dev_syscon(struct platform_device *pdev,
 	struct device_node *np = pdev->dev.of_node;
 	struct device *dev = &pdev->dev;
 
-	if (!of_property_read_bool(np, "ti,syscon-dev")) {
+	if (!of_property_present(np, "ti,syscon-dev")) {
 		dev_err(dev, "ti,syscon-dev property is absent\n");
 		return -EINVAL;
 	}
drivers/remoteproc/omap_remoteproc.c +1 -1
index cb01354248af..6ed0f28edac9 100644
@@ -1140,7 +1140,7 @@ static int omap_rproc_get_boot_data(struct platform_device *pdev,
 	if (!data)
 		return -ENODEV;
 
-	if (!of_property_read_bool(np, "ti,bootreg"))
+	if (!of_property_present(np, "ti,bootreg"))
 		return 0;
 
 	oproc->boot_data = devm_kzalloc(&pdev->dev, sizeof(*oproc->boot_data),
Signature · 1 line
2.53.0
maintainer
#1 lore raw
Quoted 32 lines · Rob Herring (Arm)

The OMAP and Keystone remoteproc drivers only need to know whether "ti,bootreg" and "ti,syscon-dev" are present before parsing them. Reading those properties as booleans misrepresents their DT encoding.

Use of_property_present() for the presence tests and keep the existing phandle parsing for the actual property values.

Assisted-by Codex:gpt-5-5
---
 drivers/remoteproc/keystone_remoteproc.c | 2 +-
 drivers/remoteproc/omap_remoteproc.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/remoteproc/keystone_remoteproc.c +1 -1
index e7fde5509786..83763d640c4e 100644
@@ -317,7 +317,7 @@ static int keystone_rproc_of_get_dev_syscon(struct platform_device *pdev,
 	struct device_node *np = pdev->dev.of_node;
 	struct device *dev = &pdev->dev;
 
-	if (!of_property_read_bool(np, "ti,syscon-dev")) {
+	if (!of_property_present(np, "ti,syscon-dev")) {
 		dev_err(dev, "ti,syscon-dev property is absent\n");
 		return -EINVAL;
 	}
drivers/remoteproc/omap_remoteproc.c +0 -0
index cb01354248af..6ed0f28edac9 100644

drivers/remoteproc/omap_remoteproc.c static int omap_rproc_get_boot_data(struct platform_device *pdev, · line 1145

Quoted 7 lines
drivers/remoteproc/omap_remoteproc.c +1 -1
@@ -1140,7 +1140,7 @@ static int omap_rproc_get_boot_data(struct platform_device *pdev,
 	if (!data)
 		return -ENODEV;
 
-	if (!of_property_read_bool(np, "ti,bootreg"))
+	if (!of_property_present(np, "ti,bootreg"))
 		return 0;
 

I'll apply this when rc1 comes out next week.

Thanks,
Mathieu

Quoted 4 lines
drivers/remoteproc/omap_remoteproc.c +0 -0
 	oproc->boot_data = devm_kzalloc(&pdev->dev, sizeof(*oproc->boot_data),
Signature · 1 line
2.53.0
maintainer Applied
#2 lore raw
In reply to Rob Herring (Arm)
Quoted 7 lines · Rob Herring (Arm)

The OMAP and Keystone remoteproc drivers only need to know whether "ti,bootreg" and "ti,syscon-dev" are present before parsing them. Reading those properties as booleans misrepresents their DT encoding.

Use of_property_present() for the presence tests and keep the existing phandle parsing for the actual property values.

Quoted 7 lines
Assisted-by Codex:gpt-5-5
---
 drivers/remoteproc/keystone_remoteproc.c | 2 +-
 drivers/remoteproc/omap_remoteproc.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Applied.

Thanks,
Mathieu

Quoted 29 lines
drivers/remoteproc/keystone_remoteproc.c +1 -1
index e7fde5509786..83763d640c4e 100644
@@ -317,7 +317,7 @@ static int keystone_rproc_of_get_dev_syscon(struct platform_device *pdev,
 	struct device_node *np = pdev->dev.of_node;
 	struct device *dev = &pdev->dev;
 
-	if (!of_property_read_bool(np, "ti,syscon-dev")) {
+	if (!of_property_present(np, "ti,syscon-dev")) {
 		dev_err(dev, "ti,syscon-dev property is absent\n");
 		return -EINVAL;
 	}
drivers/remoteproc/omap_remoteproc.c +1 -1
index cb01354248af..6ed0f28edac9 100644
@@ -1140,7 +1140,7 @@ static int omap_rproc_get_boot_data(struct platform_device *pdev,
 	if (!data)
 		return -ENODEV;
 
-	if (!of_property_read_bool(np, "ti,bootreg"))
+	if (!of_property_present(np, "ti,bootreg"))
 		return 0;
 
 	oproc->boot_data = devm_kzalloc(&pdev->dev, sizeof(*oproc->boot_data),
Signature · 1 line
2.53.0