The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v1 1/2] lib-string-introduce-match_string-helper fix
@ 2016-02-08 14:06 Andy Shevchenko
  2016-02-08 14:06 ` [PATCH v1 2/2] device-property-convert-to-use-match_string-helper fix Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2016-02-08 14:06 UTC (permalink / raw)
  To: Andrew Morton, Rasmus Villemoes, linux-kernel; +Cc: Andy Shevchenko

Fix return code to be -EINVAL instead of -ENODATA.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 lib/string.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/string.c b/lib/string.c
index f2a8fa6..ed83562 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -637,7 +637,7 @@ EXPORT_SYMBOL(sysfs_streq);
  * @string:	string to match with
  *
  * Return:
- * index of a @string in the @array if matches, or %-ENODATA otherwise.
+ * index of a @string in the @array if matches, or %-EINVAL otherwise.
  */
 int match_string(const char * const *array, size_t n, const char *string)
 {
@@ -652,7 +652,7 @@ int match_string(const char * const *array, size_t n, const char *string)
 			return index;
 	}
 
-	return -ENODATA;
+	return -EINVAL;
 }
 EXPORT_SYMBOL(match_string);
 
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH v1 2/2] device-property-convert-to-use-match_string-helper fix
  2016-02-08 14:06 [PATCH v1 1/2] lib-string-introduce-match_string-helper fix Andy Shevchenko
@ 2016-02-08 14:06 ` Andy Shevchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2016-02-08 14:06 UTC (permalink / raw)
  To: Andrew Morton, Rasmus Villemoes, linux-kernel; +Cc: Andy Shevchenko

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

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-08 14:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-08 14:06 [PATCH v1 1/2] lib-string-introduce-match_string-helper fix Andy Shevchenko
2016-02-08 14:06 ` [PATCH v1 2/2] device-property-convert-to-use-match_string-helper fix Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox