Skip to contentSkip to conversation

of/platform: Clean up a return type in of_link_property()

PATCH In review Dan Carpenter 2 participants 2 messages Aug 8, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 of/platform: Clean up a return type in of_link_property()

This function is supposed to return zero on success and negative error codes on failure but currently it returns true on failure. The caller only checks for zero and non-zero so this mixup doesn't cause any runtime issues.

Fixes 690ff7881b26 ("of/platform: Add functional dependency link from DT bindings")
---
 drivers/of/platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/platform.c +1 -1
index 21838226d68a..86fb8ab8c012 100644
@@ -625,7 +625,7 @@ static const struct supplier_bindings bindings[] = {
 	{ },
 };
 
-static bool of_link_property(struct device *dev, struct device_node *con_np,
+static int of_link_property(struct device *dev, struct device_node *con_np,
 			     const char *prop)
 {
 	struct device_node *phandle;
Signature · 1 line
2.20.1
#1 lore raw
Quoted 17 lines · Dan Carpenter

This function is supposed to return zero on success and negative error codes on failure but currently it returns true on failure. The caller only checks for zero and non-zero so this mixup doesn't cause any runtime issues.

Fixes 690ff7881b26 ("of/platform: Add functional dependency link from DT bindings")
---
 drivers/of/platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/platform.c +0 -0
index 21838226d68a..86fb8ab8c012 100644

drivers/of/platform.c static const struct supplier_bindings bindings[] = { · line 631

Quoted 8 lines
drivers/of/platform.c +1 -1
@@ -625,7 +625,7 @@ static const struct supplier_bindings bindings[] = {
 	{ },
 };
 
-static bool of_link_property(struct device *dev, struct device_node *con_np,
+static int of_link_property(struct device *dev, struct device_node *con_np,
 			     const char *prop)
 {
 	struct device_node *phandle;

Hi Dan,

Thanks for catching this.

Another patch was submitted to fix this just before your patch.

-Frank