Commit 405570b4 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Jonathan Cameron

iio: adc: ad7791: Use sysfs_match_string() helper

Use sysfs_match_string() helper instead of open coded variant.

Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Michael Hennerich <Michael.Hennerich@analog.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 02e9a0ff
...@@ -272,11 +272,9 @@ static ssize_t ad7791_write_frequency(struct device *dev, ...@@ -272,11 +272,9 @@ static ssize_t ad7791_write_frequency(struct device *dev,
struct ad7791_state *st = iio_priv(indio_dev); struct ad7791_state *st = iio_priv(indio_dev);
int i, ret; int i, ret;
for (i = 0; i < ARRAY_SIZE(ad7791_sample_freq_avail); i++) i = sysfs_match_string(ad7791_sample_freq_avail, buf);
if (sysfs_streq(ad7791_sample_freq_avail[i], buf)) if (i < 0)
break; return i;
if (i == ARRAY_SIZE(ad7791_sample_freq_avail))
return -EINVAL;
ret = iio_device_claim_direct_mode(indio_dev); ret = iio_device_claim_direct_mode(indio_dev);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment