Re: [PATCH v2 02/11] gpiolib: add support for scope-based management to gpio_device

From: Andy Shevchenko
Date: Tue Sep 12 2023 - 07:34:45 EST


On Tue, Sep 12, 2023 at 12:07:18PM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
>
> As the few users that need to get the reference to the GPIO device often
> release it right after inspecting its properties, let's add support for
> the automatic reference release to struct gpio_device.

...

> +DEFINE_FREE(gpio_device_put, struct gpio_device *, if (_T) gpio_device_put(_T));

Looks like this should be

if (!IS_ERR_OR_NULL(_T))

(with linux/err.h included).

--
With Best Regards,
Andy Shevchenko