diff options
author | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2023-12-15 18:53:00 +0300 |
---|---|---|
committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2023-12-18 12:00:43 +0300 |
commit | 65a828bab15887b33336d251fd659b2ae86de6d6 (patch) | |
tree | 3b33dddd67f9d8914c1034ea0d09cf47723a77df /drivers/gpio/gpiolib-sysfs.h | |
parent | f95fd4ac155733b5735c84a2e56eee8321232095 (diff) | |
download | linux-65a828bab15887b33336d251fd659b2ae86de6d6.tar.xz |
gpiolib: use a mutex to protect the list of GPIO devices
The global list of GPIO devices is never modified or accessed from
atomic context so it's fine to protect it using a mutex. Add a new
global lock dedicated to the gpio_devices list and use it whenever
accessing or modifying it.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/gpio/gpiolib-sysfs.h')
-rw-r--r-- | drivers/gpio/gpiolib-sysfs.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpio/gpiolib-sysfs.h b/drivers/gpio/gpiolib-sysfs.h index b794b396d6a5..ab157cec0b4b 100644 --- a/drivers/gpio/gpiolib-sysfs.h +++ b/drivers/gpio/gpiolib-sysfs.h @@ -8,6 +8,7 @@ struct gpio_device; #ifdef CONFIG_GPIO_SYSFS int gpiochip_sysfs_register(struct gpio_device *gdev); +int gpiochip_sysfs_register_all(void); void gpiochip_sysfs_unregister(struct gpio_device *gdev); #else @@ -17,6 +18,11 @@ static inline int gpiochip_sysfs_register(struct gpio_device *gdev) return 0; } +static inline int gpiochip_sysfs_register_all(void) +{ + return 0; +} + static inline void gpiochip_sysfs_unregister(struct gpio_device *gdev) { } |