summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpiolib-sysfs.h
diff options
context:
space:
mode:
authorKent Gibson <warthog618@gmail.com>2020-07-08 12:15:44 +0800
committerBartosz Golaszewski <bgolaszewski@baylibre.com>2020-07-12 10:22:00 +0200
commitef087d8e95d9d225f83e92d02c3eae1a41955c5f (patch)
tree9be8f7462b7322606a18901a663d8d975190a16e /drivers/gpio/gpiolib-sysfs.h
parent4672a4a9fbfe316e1153682b0790af6446255a50 (diff)
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>
Diffstat (limited to 'drivers/gpio/gpiolib-sysfs.h')
-rw-r--r--drivers/gpio/gpiolib-sysfs.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/gpio/gpiolib-sysfs.h b/drivers/gpio/gpiolib-sysfs.h
new file mode 100644
index 000000000000..ddd0e503f8eb
--- /dev/null
+++ b/drivers/gpio/gpiolib-sysfs.h
@@ -0,0 +1,24 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef GPIOLIB_SYSFS_H
+#define GPIOLIB_SYSFS_H
+
+#ifdef CONFIG_GPIO_SYSFS
+
+int gpiochip_sysfs_register(struct gpio_device *gdev);
+void gpiochip_sysfs_unregister(struct gpio_device *gdev);
+
+#else
+
+static inline int gpiochip_sysfs_register(struct gpio_device *gdev)
+{
+ return 0;
+}
+
+static inline void gpiochip_sysfs_unregister(struct gpio_device *gdev)
+{
+}
+
+#endif /* CONFIG_GPIO_SYSFS */
+
+#endif /* GPIOLIB_SYSFS_H */