mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: David Brownell <david-b@pacbell.net>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>, lkml <linux-kernel@vger.kernel.org>
Subject: Re: [patch 2.6.29-rc] regulator: minor cleanup of virtual consumer
Date: Wed, 14 Jan 2009 22:36:14 +0000	[thread overview]
Message-ID: <D7FBA37A-AB5A-47FE-A7AC-681E1E7DC5E4@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <200901141316.27584.david-b@pacbell.net>

On 14 Jan 2009, at 21:16, David Brownell <david-b@pacbell.net> wrote:

> From: David Brownell <dbrownell@users.sourceforge.net>
>
> Minor cleanup to the regulator set_mode sysfs support:
> switch to sysfs_streq() in set_mode(), which is also
> a code shrink.  Use the same strings that get_mode()
> uses, shrinking data too.
>
> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>

Excellent, thanks!

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

>
> ---
> drivers/regulator/virtual.c |    8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> --- a/drivers/regulator/virtual.c
> +++ b/drivers/regulator/virtual.c
> @@ -226,13 +226,13 @@ static ssize_t set_mode(struct device *d
>    unsigned int mode;
>    int ret;
>
> -    if (strncmp(buf, "fast", strlen("fast")) == 0)
> +    if (sysfs_streq(buf, "fast\n") == 0)
>        mode = REGULATOR_MODE_FAST;
> -    else if (strncmp(buf, "normal", strlen("normal")) == 0)
> +    else if (sysfs_streq(buf, "normal\n") == 0)
>        mode = REGULATOR_MODE_NORMAL;
> -    else if (strncmp(buf, "idle", strlen("idle")) == 0)
> +    else if (sysfs_streq(buf, "idle\n") == 0)
>        mode = REGULATOR_MODE_IDLE;
> -    else if (strncmp(buf, "standby", strlen("standby")) == 0)
> +    else if (sysfs_streq(buf, "standby\n") == 0)
>        mode = REGULATOR_MODE_STANDBY;
>    else {
>        dev_err(dev, "Configuring invalid mode\n");

  reply	other threads:[~2009-01-14 22:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-14 21:16 David Brownell
2009-01-14 22:36 ` Mark Brown [this message]
2009-01-15 12:04 ` Liam Girdwood
2009-01-16  0:10 ` Andrew Morton
2009-01-16  0:13   ` Andrew Morton
2009-01-16  1:13     ` Mark Brown
2009-01-16 12:21     ` Liam Girdwood
2009-01-16  1:06   ` David Brownell

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=D7FBA37A-AB5A-47FE-A7AC-681E1E7DC5E4@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=david-b@pacbell.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®