You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The logic of extract_pin_from_path is too rigid, expecting GPIOs to only
exist at the "/sys/class/gpio" path. The problem with this is that the
kernel may actually symlink the directory in "/sys/class/gpio" to a chip
or SOC-specific path, and the logic prior to extracting the pin from the
path performs a canonicalization, breaking the assumption.
So, for example, the following is the output of a gpio on the board I'm
working with:
root# readlink /var/run/gpio/hwid-0
/sys/class/gpio/gpio122
root# readlink /sys/class/gpio/gpio122
../../devices/soc0/soc/2000000.aips-bus/20a8000.gpio/gpiochip3/gpio/gpio122
This commit fixes the issue by relaxing the restrictions of
extract_pin_from_path to only look for a final file component that looks
like "gpioXXXX".
Signed-off-by: Nick Stevens <nick@bitcurry.com>
0 commit comments