summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib-cdev.h
diff options
context:
space:
mode:
authorKent Gibson <warthog618@gmail.com>2020-11-05 11:40:49 +0100
committerBartosz Golaszewski <bgolaszewski@baylibre.com>2020-11-05 15:35:40 +0100
commit1f5eb8b17f02d216703ee56e4c3115f592b060fb (patch)
treef88cceed309ff11b4ca16d68d2f890228fc862a0 /drivers/gpio/gpiolib-cdev.h
parentgpio: aspeed: fix ast2600 bank properties (diff)
downloadlinux-1f5eb8b17f02d216703ee56e4c3115f592b060fb.tar.xz
linux-1f5eb8b17f02d216703ee56e4c3115f592b060fb.zip
gpiolib: fix sysfs when cdev is not selected
In gpiochip_setup_dev() the call to gpiolib_cdev_register() indirectly calls device_add(). This is still required for the sysfs even when CONFIG_GPIO_CDEV is not selected in the build. Replace the stubbed functions in gpiolib-cdev.h with macros in gpiolib.c that perform the required device_add() and device_del() when CONFIG_GPIO_CDEV is not selected. Fixes: d143493c01b7 (gpiolib: make cdev a build option) Reported-by: Nicolas Schichan <nschichan@freebox.fr> Signed-off-by: Kent Gibson <warthog618@gmail.com> Tested-by: Nicolas Schichan <nschichan@freebox.fr> 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, 0 insertions, 15 deletions
diff --git a/drivers/gpio/gpiolib-cdev.h b/drivers/gpio/gpiolib-cdev.h
index cb41dd757338..b42644cbffb8 100644
--- a/drivers/gpio/gpiolib-cdev.h
+++ b/drivers/gpio/gpiolib-cdev.h
@@ -7,22 +7,7 @@
struct gpio_device;
-#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 */