Message ID | 20241031-gpio-notify-sysfs-v4-3-142021c2195c@linaro.org |
---|---|
State | New |
Headers | show |
Series | [v4,1/5] gpio: sysfs: use cleanup guards for gpiod_data::mutex | expand |
diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c index e6c1e26f302d..dd5e850c9517 100644 --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c @@ -21,6 +21,8 @@ #include <linux/gpio/consumer.h> #include <linux/gpio/driver.h> +#include <uapi/linux/gpio.h> + #include "gpiolib.h" #include "gpiolib-sysfs.h" @@ -471,10 +473,12 @@ static ssize_t export_store(const struct class *class, } status = gpiod_export(desc, true); - if (status < 0) + if (status < 0) { gpiod_free(desc); - else + } else { set_bit(FLAG_SYSFS, &desc->flags); + gpiod_line_state_notify(desc, GPIO_V2_LINE_CHANGED_REQUESTED); + } done: if (status)