}
EXPORT_SYMBOL_GPL(iio_buffer_enabled);
-/**
- * iio_sysfs_match_string_with_gaps - matches given string in an array with gaps
- * @array: array of strings
- * @n: number of strings in the array
- * @str: string to match with
- *
- * Returns index of @str in the @array or -EINVAL, similar to match_string().
- * Uses sysfs_streq instead of strcmp for matching.
- *
- * This routine will look for a string in an array of strings.
- * The search will continue until the element is found or the n-th element
- * is reached, regardless of any NULL elements in the array.
- */
-static int iio_sysfs_match_string_with_gaps(const char * const *array, size_t n,
- const char *str)
-{
- const char *item;
- int index;
-
- for (index = 0; index < n; index++) {
- item = array[index];
- if (!item)
- continue;
- if (sysfs_streq(item, str))
- return index;
- }
-
- return -EINVAL;
-}
-
#if defined(CONFIG_DEBUG_FS)
/*
* There's also a CONFIG_DEBUG_FS guard in include/linux/iio/iio.h for
if (!e->set)
return -EINVAL;
- ret = iio_sysfs_match_string_with_gaps(e->items, e->num_items, buf);
+ ret = __sysfs_match_string(e->items, e->num_items, buf);
if (ret < 0)
return ret;