From: Jonathan Cameron Date: Fri, 15 Apr 2011 17:55:53 +0000 (+0100) Subject: staging:iio:trigger remove export of iio_trigger_find_by_name, use sysfs_streq for... X-Git-Tag: v3.0-rc1~336^2~685 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f6517f22d4f6336ce37dc6b72aae4704ff872ba3;p=profile%2Fivi%2Fkernel-x86-ivi.git staging:iio:trigger remove export of iio_trigger_find_by_name, use sysfs_streq for matching Trivial reorganization. Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/iio/industrialio-trigger.c b/drivers/staging/iio/industrialio-trigger.c index 57dd923..714ce06 100644 --- a/drivers/staging/iio/industrialio-trigger.c +++ b/drivers/staging/iio/industrialio-trigger.c @@ -151,26 +151,21 @@ void iio_trigger_unregister(struct iio_trigger *trig_info) } EXPORT_SYMBOL(iio_trigger_unregister); -struct iio_trigger *iio_trigger_find_by_name(const char *name, size_t len) +static 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--; + struct iio_trigger *trig = NULL, *iter; mutex_lock(&iio_trigger_list_lock); - list_for_each_entry(trig, &iio_trigger_list, list) { - if (strncmp(trig->name, name, len) == 0) { - found = true; + list_for_each_entry(iter, &iio_trigger_list, list) + if (sysfs_streq(iter->name, name)) { + trig = iter; break; } - } mutex_unlock(&iio_trigger_list_lock); - return found ? trig : NULL; + return trig; } -EXPORT_SYMBOL(iio_trigger_find_by_name); void iio_trigger_poll(struct iio_trigger *trig, s64 time) { diff --git a/drivers/staging/iio/trigger.h b/drivers/staging/iio/trigger.h index 469beba..c6ab32f 100644 --- a/drivers/staging/iio/trigger.h +++ b/drivers/staging/iio/trigger.h @@ -77,13 +77,6 @@ ssize_t iio_trigger_read_name(struct device *dev, NULL); /** - * iio_trigger_find_by_name() - search global trigger list - * @name: trigger name to search for - * @len: trigger name string length to compare - **/ -struct iio_trigger *iio_trigger_find_by_name(const char *name, size_t len); - -/** * iio_trigger_register() - register a trigger with the IIO core * @trig_info: trigger to be registered **/