linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpiolib: fix unwatch ioctl()
@ 2020-02-24 14:49 Kent Gibson
  2020-02-24 15:37 ` Bartosz Golaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Kent Gibson @ 2020-02-24 14:49 UTC (permalink / raw)
  To: linux-kernel, linux-gpio, bgolaszewski, linus.walleij; +Cc: Kent Gibson

Fix the field having a bit cleared by the unwatch ioctl().

Fixes: 51c1064e82e7 ("gpiolib: add new ioctl() for monitoring changes in line info")
Signed-off-by: Kent Gibson <warthog618@gmail.com>

---

I had written some tests for v1 of the new ioctl patch series, and just
updated them to run against the v6, which is now in gpio/for-next.

I found the Unwatch ioctl suffered a regression - it simply didn't work
anymore, though it wasn't returning any error.

This patch fixes that regression.

 drivers/gpio/gpiolib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 73a1e0831eeb..2411562a9bac 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1276,7 +1276,7 @@ static long gpio_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 		if (IS_ERR(desc))
 			return PTR_ERR(desc);
 
-		clear_bit(desc_to_gpio(desc), &desc->flags);
+		clear_bit(desc_to_gpio(desc), priv->watched_lines);
 		return 0;
 	}
 	return -EINVAL;
-- 
2.25.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] gpiolib: fix unwatch ioctl()
  2020-02-24 14:49 [PATCH] gpiolib: fix unwatch ioctl() Kent Gibson
@ 2020-02-24 15:37 ` Bartosz Golaszewski
  0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2020-02-24 15:37 UTC (permalink / raw)
  To: Kent Gibson; +Cc: LKML, linux-gpio, Linus Walleij

pon., 24 lut 2020 o 15:50 Kent Gibson <warthog618@gmail.com> napisał(a):
>
> Fix the field having a bit cleared by the unwatch ioctl().
>
> Fixes: 51c1064e82e7 ("gpiolib: add new ioctl() for monitoring changes in line info")
> Signed-off-by: Kent Gibson <warthog618@gmail.com>
>
> ---
>
> I had written some tests for v1 of the new ioctl patch series, and just
> updated them to run against the v6, which is now in gpio/for-next.
>
> I found the Unwatch ioctl suffered a regression - it simply didn't work
> anymore, though it wasn't returning any error.
>
> This patch fixes that regression.
>
>  drivers/gpio/gpiolib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index 73a1e0831eeb..2411562a9bac 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -1276,7 +1276,7 @@ static long gpio_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
>                 if (IS_ERR(desc))
>                         return PTR_ERR(desc);
>
> -               clear_bit(desc_to_gpio(desc), &desc->flags);
> +               clear_bit(desc_to_gpio(desc), priv->watched_lines);
>                 return 0;
>         }
>         return -EINVAL;
> --
> 2.25.0
>

Thanks for catching this. Applied!

Bart

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-24 15:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-24 14:49 [PATCH] gpiolib: fix unwatch ioctl() Kent Gibson
2020-02-24 15:37 ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).