mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
iio: adc: ad7791: Use sysfs_match_string() helper
Use sysfs_match_string() helper instead of open coded variant. Cc: Lars-Peter Clausen <[email protected]> Cc: Michael Hennerich <[email protected]> Cc: Jonathan Cameron <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
This commit is contained in:
parent
02e9a0ff0d
commit
405570b4a5
1 changed files with 3 additions and 5 deletions
|
|
@ -272,11 +272,9 @@ static ssize_t ad7791_write_frequency(struct device *dev,
|
|||
struct ad7791_state *st = iio_priv(indio_dev);
|
||||
int i, ret;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(ad7791_sample_freq_avail); i++)
|
||||
if (sysfs_streq(ad7791_sample_freq_avail[i], buf))
|
||||
break;
|
||||
if (i == ARRAY_SIZE(ad7791_sample_freq_avail))
|
||||
return -EINVAL;
|
||||
i = sysfs_match_string(ad7791_sample_freq_avail, buf);
|
||||
if (i < 0)
|
||||
return i;
|
||||
|
||||
ret = iio_device_claim_direct_mode(indio_dev);
|
||||
if (ret)
|
||||
|
|
|
|||
Loading…
Reference in a new issue