Re: [PATCH 3/5] gpiolib: add support for scope-based management of GPIO descriptors

From: Linus Walleij

Date: Wed Nov 04 2026 - 08:09:54 EST


On Wed, Oct 21, 2026 at 9:02 PM Dmitry Torokhov
<dmitry.torokhov@xxxxxxxxx> wrote:

> Add DEFINE_FREE() definitions for gpiod_put and gpiod_put_array to
> allow using __free(gpiod_put) and __free(gpiod_put_array) for automatic,
> scope-based cleanup of individual GPIO descriptors and descriptor
> arrays. Place these definitions after the CONFIG_GPIOLIB check so that
> they are available regardless of whether CONFIG_GPIOLIB is enabled.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>

Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>

Yours,
Linus Walleij