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