]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
staging:iio:trigger remove export of iio_trigger_find_by_name, use sysfs_streq for...
authorJonathan Cameron <jic23@cam.ac.uk>
Fri, 15 Apr 2011 17:55:53 +0000 (18:55 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 26 Apr 2011 00:23:08 +0000 (17:23 -0700)
Trivial reorganization.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/industrialio-trigger.c
drivers/staging/iio/trigger.h

index 57dd9232cf0d91884dad5af732ab9e21fdbe150b..714ce06f9dbc3f9c4253edf220fd952897c7ac12 100644 (file)
@@ -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)
 {
index 469beba3e71dd7e5294bf75d9d0386fb81cdaa02..c6ab32f74c8b5fdc72b9a78d0c62a13d8d23451a 100644 (file)
@@ -76,13 +76,6 @@ ssize_t iio_trigger_read_name(struct device *dev,
                                          iio_trigger_read_name,        \
                                          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