mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-11 00:08:50 +00:00
staging:iio:trigger remove export of iio_trigger_find_by_name, use sysfs_streq for matching
Trivial reorganization. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
67d1c1f4e0
commit
f6517f22d4
@ -151,26 +151,21 @@ void iio_trigger_unregister(struct iio_trigger *trig_info)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(iio_trigger_unregister);
|
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;
|
struct iio_trigger *trig = NULL, *iter;
|
||||||
bool found = false;
|
|
||||||
|
|
||||||
if (len && name[len - 1] == '\n')
|
|
||||||
len--;
|
|
||||||
|
|
||||||
mutex_lock(&iio_trigger_list_lock);
|
mutex_lock(&iio_trigger_list_lock);
|
||||||
list_for_each_entry(trig, &iio_trigger_list, list) {
|
list_for_each_entry(iter, &iio_trigger_list, list)
|
||||||
if (strncmp(trig->name, name, len) == 0) {
|
if (sysfs_streq(iter->name, name)) {
|
||||||
found = true;
|
trig = iter;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
mutex_unlock(&iio_trigger_list_lock);
|
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)
|
void iio_trigger_poll(struct iio_trigger *trig, s64 time)
|
||||||
{
|
{
|
||||||
|
@ -76,13 +76,6 @@ ssize_t iio_trigger_read_name(struct device *dev,
|
|||||||
iio_trigger_read_name, \
|
iio_trigger_read_name, \
|
||||||
NULL);
|
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
|
* iio_trigger_register() - register a trigger with the IIO core
|
||||||
* @trig_info: trigger to be registered
|
* @trig_info: trigger to be registered
|
||||||
|
Loading…
x
Reference in New Issue
Block a user