Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpiolib: move gpiolib-sysfs function declarations into their own header

Move gpiolib-sysfs function declarations into their own header.

These functions are in gpiolib-sysfs.c, and are only required by gpiolib.c,
and so should be in a module header, not gpiolib.h.

This brings gpiolib-sysfs into line with gpiolib-cdev, and is another step
towards removing the sysfs inferface.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

authored by

Kent Gibson and committed by
Bartosz Golaszewski
ef087d8e 4672a4a9

+26 -18
+1
drivers/gpio/gpiolib-sysfs.c
··· 11 11 #include <linux/ctype.h> 12 12 13 13 #include "gpiolib.h" 14 + #include "gpiolib-sysfs.h" 14 15 15 16 #define GPIO_IRQF_TRIGGER_FALLING BIT(0) 16 17 #define GPIO_IRQF_TRIGGER_RISING BIT(1)
+24
drivers/gpio/gpiolib-sysfs.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + 3 + #ifndef GPIOLIB_SYSFS_H 4 + #define GPIOLIB_SYSFS_H 5 + 6 + #ifdef CONFIG_GPIO_SYSFS 7 + 8 + int gpiochip_sysfs_register(struct gpio_device *gdev); 9 + void gpiochip_sysfs_unregister(struct gpio_device *gdev); 10 + 11 + #else 12 + 13 + static inline int gpiochip_sysfs_register(struct gpio_device *gdev) 14 + { 15 + return 0; 16 + } 17 + 18 + static inline void gpiochip_sysfs_unregister(struct gpio_device *gdev) 19 + { 20 + } 21 + 22 + #endif /* CONFIG_GPIO_SYSFS */ 23 + 24 + #endif /* GPIOLIB_SYSFS_H */
+1
drivers/gpio/gpiolib.c
··· 26 26 #include "gpiolib-of.h" 27 27 #include "gpiolib-acpi.h" 28 28 #include "gpiolib-cdev.h" 29 + #include "gpiolib-sysfs.h" 29 30 30 31 #define CREATE_TRACE_POINTS 31 32 #include <trace/events/gpio.h>
-18
drivers/gpio/gpiolib.h
··· 175 175 #define chip_dbg(gc, fmt, ...) \ 176 176 dev_dbg(&gc->gpiodev->dev, "(%s): " fmt, gc->label, ##__VA_ARGS__) 177 177 178 - #ifdef CONFIG_GPIO_SYSFS 179 - 180 - int gpiochip_sysfs_register(struct gpio_device *gdev); 181 - void gpiochip_sysfs_unregister(struct gpio_device *gdev); 182 - 183 - #else 184 - 185 - static inline int gpiochip_sysfs_register(struct gpio_device *gdev) 186 - { 187 - return 0; 188 - } 189 - 190 - static inline void gpiochip_sysfs_unregister(struct gpio_device *gdev) 191 - { 192 - } 193 - 194 - #endif /* CONFIG_GPIO_SYSFS */ 195 - 196 178 #endif /* GPIOLIB_H */