From: Bartosz Golaszewski Date: Fri, 4 Jul 2025 12:58:48 +0000 (+0200) Subject: gpio: sysfs: use gpiod_is_equal() to compare GPIO descriptors X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32ad0b9a17f9aa8dd9308feda671bda98b274d24;p=thirdparty%2Fkernel%2Flinux.git gpio: sysfs: use gpiod_is_equal() to compare GPIO descriptors We have a dedicated comparator for GPIO descriptors that performs additional checks and hides the implementation detail of whether the same GPIO can be associated with two separate struct gpio_desc objects. Use it in sysfs code Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20250704-gpio-sysfs-chip-export-v4-1-9289d8758243@linaro.org Signed-off-by: Bartosz Golaszewski --- diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c index c4c21e25c682b..c4e85f2827697 100644 --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c @@ -657,7 +657,7 @@ static int match_export(struct device *dev, const void *desc) { struct gpiod_data *data = dev_get_drvdata(dev); - return data->desc == desc; + return gpiod_is_equal(data->desc, desc); } /**