On Fri, Jul 1, 2022 at 1:43 PM Kent Gibson <warthog618@xxxxxxxxx> wrote: > > On Fri, Jul 01, 2022 at 01:00:56PM +0200, Bartosz Golaszewski wrote: > > This function should just report whether the file indicated by path is > > a GPIO chip or not. Let's rework it to not set errno. Failure to open a > > chip should still report errro numbers like before. > > > > This is will break my tool patch, for sure. > My gpiodetect uses the errno behaviour to give a clue as to why a chip > might not be available to a user, and that work was already done in > gpiod_is_gpiochip_device(). > There might be other places the errno was propagated as well, but > whatever, I'll sort something out. > Doesn't it make more sense to call gpiod_is_gpiochip_device() and then if it returns true, just try to open it and then report failure? Bart