diff options
author | Michael Hennerich <Michael.Hennerich@analog.com> | 2010-04-26 10:49:10 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-11 11:35:46 -0700 |
commit | 7c327857016116eba1595c67c25d0314d1385e85 (patch) | |
tree | 40d26ec5269c6c75ccd95987dbece175536311da /drivers/staging/iio | |
parent | a05d7ce36c55bc6496e1085584c9df901b899ab2 (diff) | |
download | op-kernel-dev-7c327857016116eba1595c67c25d0314d1385e85.zip op-kernel-dev-7c327857016116eba1595c67c25d0314d1385e85.tar.gz |
Staging: iio: iio_trigger_find_by_name: Skip trailing newline if available
Skip trailing newline if available.
Signed-off-by: Michael Hennerich <Michael.Hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio')
-rw-r--r-- | drivers/staging/iio/industrialio-trigger.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/staging/iio/industrialio-trigger.c b/drivers/staging/iio/industrialio-trigger.c index 35ec80b..3c8f6ff 100644 --- a/drivers/staging/iio/industrialio-trigger.c +++ b/drivers/staging/iio/industrialio-trigger.c @@ -156,6 +156,9 @@ struct iio_trigger *iio_trigger_find_by_name(const char *name, size_t len) struct iio_trigger *trig; bool found = false; + if (len && name[len - 1] == '\n') + len--; + mutex_lock(&iio_trigger_list_lock); list_for_each_entry(trig, &iio_trigger_list, list) { if (strncmp(trig->name, name, len) == 0) { |