[PATCH v1 2/2] device-property-convert-to-use-match_string-helper fix

From: Andy Shevchenko
Date: Mon Feb 08 2016 - 09:08:36 EST


Since match_string() returns -EINVAL let's convert it to -ENODATA as designed
by device property API.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---
drivers/base/property.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/base/property.c b/drivers/base/property.c
index f902b55..167f0a9 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -665,6 +665,8 @@ int fwnode_property_match_string(struct fwnode_handle *fwnode,
goto out;

ret = match_string(values, nval, string);
+ if (ret < 0)
+ ret = -ENODATA;
out:
kfree(values);
return ret;
--
2.7.0