]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
gpio: sysfs: make the sysfs export behavior consistent
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 30 Sep 2024 08:30:29 +0000 (10:30 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 2 Oct 2024 14:30:12 +0000 (16:30 +0200)
commit700cdf7ed00f0cf20fdcef33d56e862768eb1008
tree7cb44f8f6902628233ee68dc3b57994a0b31a3d8
parent35c013ac7362a5470d5f30f3da0af50215095121
gpio: sysfs: make the sysfs export behavior consistent

For drivers or board files that set gpio_chip->names, the links to the
GPIO attribute group created on sysfs export will be named after the
line's name set in that array. For lines that are named using device
properties, the names pointer of the gpio_chip struct is never assigned
so they are exported as if they're not named.

The ABI documentation does not mention the former behavior and given
that the majority of modern systems use device-tree, ACPI or other way
of passing GPIO names using device properties - bypassing gc->names -
it's better to make the behavior consistent by always exporting lines as
"gpioXYZ".

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240930083029.17694-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpiolib-sysfs.c