of/platform: fix compilation warning of of_link_property()
PATCH 1/1 of/platform: fix compilation warning of of_link_property()
GCC warns that a negative integer can be returned but the of_link_property() function should return a boolean.
../drivers/of/platform.c: In function ‘of_link_property’:../drivers/of/platform.c:650:18: warning: ?: using integer constants in boolean context [-Wint-in-bool-context]
return done ? 0 : -ENODEV;
Rework so function of_link_property() return an integer instead of a boolean.
--- drivers/of/platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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;
Signature · 1 line
2.20.1
Quoted 21 lines · Anders Roxell
GCC warns that a negative integer can be returned but the
of_link_property()function should return a boolean.
../drivers/of/platform.c: In function ‘of_link_property’:../drivers/of/platform.c:650:18: warning: ?: using integer constants in boolean context [-Wint-in-bool-context]
return done ? 0 :-ENODEV;Rework so function
of_link_property()return an integer instead of a boolean.Fixes 690ff7881b26 ("of/platform: Add functional dependency link from DT bindings")Signed-off-by Anders Roxell <[email protected]>--- drivers/of/platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/of/platform.c +0
-0
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 Anders,
Thanks for catching this.
Another patch was submitted to fix this just before your patch.
-Frank