[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090604005435.d3671419.akpm@linux-foundation.org>
Date: Thu, 4 Jun 2009 00:54:35 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Mike Frysinger <vapier@...too.org>
Cc: David Brownell <david-b@...bell.net>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] gpio sysfs: add a "toggle" value
On Wed, 3 Jun 2009 04:16:59 -0400 Mike Frysinger <vapier@...too.org> wrote:
> Signed-off-by: Mike Frysinger <vapier@...too.org>
-ENOCHANGELOGAGAIN
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index 51a8d41..7f79732 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -274,7 +274,12 @@ static ssize_t gpio_value_store(struct device *dev,
> else {
> long value;
>
> - status = strict_strtol(buf, 0, &value);
> + if (sysfs_streq(buf, "toggle")) {
> + value = !gpio_get_value_cansleep(gpio);
> + status = 0;
> + } else
> + status = strict_strtol(buf, 0, &value);
> +
> if (status == 0) {
> gpio_set_value_cansleep(gpio, value != 0);
> status = size;
A suitable place to document this is Documentation/gpio.txt.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists