From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-iio@vger.kernel.org, Lars-Peter Clausen <lars@metafoo.de>,
Michael Hennerich <Michael.Hennerich@analog.com>
Subject: Re: [PATCH v1] iio: adc: ad7791: Use sysfs_match_string() helper
Date: Sun, 11 Jun 2017 12:02:44 +0100 [thread overview]
Message-ID: <20170611120244.5e899136@kernel.org> (raw)
In-Reply-To: <20170609120810.22057-1-andriy.shevchenko@linux.intel.com>
On Fri, 9 Jun 2017 15:08:10 +0300
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> 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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Looks obvious enough that I'm happy to apply without waiting
for Lars or Michael to have a moment. It'll be in my testing
branch for at least a little while though if either of you
want to comment or add an Ack.
Thanks,
Jonathan
> ---
> drivers/iio/adc/ad7791.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/adc/ad7791.c b/drivers/iio/adc/ad7791.c
> index 1817ebf5ad84..34e353c43ac8 100644
> --- a/drivers/iio/adc/ad7791.c
> +++ b/drivers/iio/adc/ad7791.c
> @@ -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)
prev parent reply other threads:[~2017-06-11 11:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-09 12:08 [PATCH v1] iio: adc: ad7791: Use sysfs_match_string() helper Andy Shevchenko
2017-06-11 11:02 ` Jonathan Cameron [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170611120244.5e899136@kernel.org \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.