On Mon, Feb 5, 2024 at 1:31 PM Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote: > [snip] > > > int gpiod_get_direction(struct gpio_desc *desc) > > { > > - struct gpio_chip *gc; > > unsigned long flags; > > unsigned int offset; > > int ret; > > > > - gc = gpiod_to_chip(desc); > > + if (!desc) > > + /* Sane default is INPUT. */ > > + return 1; > > Hmm... I can't imagine how this value may anyhow be used / useful. > What else would you return for an optional (NULL) GPIO? Bart [snip]