summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpiolib-cdev.h
diff options
context:
space:
mode:
authorKent Gibson <warthog618@gmail.com>2020-09-28 08:27:52 +0800
committerBartosz Golaszewski <bgolaszewski@baylibre.com>2020-09-30 10:56:42 +0200
commitd143493c01b7fc3a9b9369a795e20329561222c5 (patch)
treea775840c49b5364aed598090f582003a706741db /drivers/gpio/gpiolib-cdev.h
parentb53911aa872db462be2e5f1dd611b25c4c2e663b (diff)
gpiolib: make cdev a build option
Make the gpiolib-cdev module a build option. This allows the CDEV interface to be removed from the kernel to reduce kernel size in applications where is it not required, and provides the parent for other CDEV interface specific build options to follow. Suggested-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Kent Gibson <warthog618@gmail.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Diffstat (limited to 'drivers/gpio/gpiolib-cdev.h')
-rw-r--r--drivers/gpio/gpiolib-cdev.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpio/gpiolib-cdev.h b/drivers/gpio/gpiolib-cdev.h
index 973578e7ad10..19a4e3d57120 100644
--- a/drivers/gpio/gpiolib-cdev.h
+++ b/drivers/gpio/gpiolib-cdev.h
@@ -5,7 +5,22 @@
#include <linux/device.h>
+#ifdef CONFIG_GPIO_CDEV
+
int gpiolib_cdev_register(struct gpio_device *gdev, dev_t devt);
void gpiolib_cdev_unregister(struct gpio_device *gdev);
+#else
+
+static inline int gpiolib_cdev_register(struct gpio_device *gdev, dev_t devt)
+{
+ return 0;
+}
+
+static inline void gpiolib_cdev_unregister(struct gpio_device *gdev)
+{
+}
+
+#endif /* CONFIG_GPIO_CDEV */
+
#endif /* GPIOLIB_CDEV_H */