Skip to content

Commit 8143e98

Browse files
author
Bartosz Golaszewski
committed
watch for "add"/"remove" uevents instead of "bind"/"unbind"
Linux has a stub driver for GPIO devices (the ones on the GPIO bus, not their parent devices!) but it only actually *binds* to it those devices that don't have a firmware node attached. This means that in some cases, a "dynamic" GPIO controller can remain unnoticed by the proxy. This behavior is related to fw_devlink handling and - even if we changed the kernel to bind all GPIO devices to the stub driver - a fix in this program is easier to distribute than a kernel fix. Since an *added* GPIO device is considered functional, even without binding to the stub driver, we can rely on the "add"/"remove" uevent pair when detecting when GPIO chips come and go. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
1 parent b71e0d9 commit 8143e98

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

gpiod-sysfs-proxy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,9 +624,9 @@ class Root(Directory):
624624
return None
625625

626626
try:
627-
if action == "bind":
627+
if action == "add":
628628
self._add_chip(device)
629-
elif action == "unbind":
629+
elif action == "remove":
630630
self._remove_chip(device)
631631
except OSError as ex:
632632
if ex.errno not in [errno.ENOENT, errno.ENODEV]:

0 commit comments

Comments
 (0)