[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMRc=MdqTPf_N-KL8jcAyH+mh+0-uot=qCCfNrRTm8s6r2DJWw@mail.gmail.com>
Date: Wed, 4 Feb 2026 08:05:37 -0500
From: Bartosz Golaszewski <brgl@...nel.org>
To: Tzung-Bi Shih <tzungbi@...nel.org>
Cc: Jonathan Corbet <corbet@....net>, Shuah Khan <shuah@...nel.org>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Wolfram Sang <wsa+renesas@...g-engineering.com>, Jason Gunthorpe <jgg@...dia.com>,
Johan Hovold <johan@...nel.org>, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org, chrome-platform@...ts.linux.dev,
Dan Williams <dan.j.williams@...el.com>, linux-gpio@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>, "Rafael J. Wysocki" <rafael@...nel.org>,
Danilo Krummrich <dakr@...nel.org>, Bartosz Golaszewski <brgl@...ev.pl>, Linus Walleij <linusw@...nel.org>
Subject: Re: [PATCH v2 09/11] gpio: Remove gpio_chip_guard by using revocable
On Tue, 3 Feb 2026 07:10:56 +0100, Tzung-Bi Shih <tzungbi@...nel.org> said:
> Struct gpio_device now provides a revocable provider to the underlying
> struct gpio_chip. Leverage revocable for accessing the struct
> gpio_chip instead of using gpio_chip_guard.
>
> Signed-off-by: Tzung-Bi Shih <tzungbi@...nel.org>
> --
[snip]
> diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h
> index cd136d5b52e9..ce6273cc74f2 100644
> --- a/drivers/gpio/gpiolib.h
> +++ b/drivers/gpio/gpiolib.h
> @@ -224,27 +224,6 @@ struct gpio_desc {
>
> #define gpiod_not_found(desc) (IS_ERR(desc) && PTR_ERR(desc) == -ENOENT)
>
> -struct gpio_chip_guard {
> - struct gpio_device *gdev;
> - struct gpio_chip *gc;
> - int idx;
> -};
> -
> -DEFINE_CLASS(gpio_chip_guard,
> - struct gpio_chip_guard,
> - srcu_read_unlock(&_T.gdev->srcu, _T.idx),
> - ({
> - struct gpio_chip_guard _guard;
> -
> - _guard.gdev = desc->gdev;
> - _guard.idx = srcu_read_lock(&_guard.gdev->srcu);
> - _guard.gc = srcu_dereference(_guard.gdev->chip,
> - &_guard.gdev->srcu);
> -
> - _guard;
> - }),
> - struct gpio_desc *desc)
> -
Ah, yes, I'll gladly export this into someone else's header. :)
Bart
Powered by blists - more mailing lists