]> git.baikalelectronics.ru Git - kernel.git/commit
gpiolib: fix sysfs when cdev is not selected
authorKent Gibson <warthog618@gmail.com>
Thu, 5 Nov 2020 10:40:49 +0000 (18:40 +0800)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Thu, 5 Nov 2020 14:35:40 +0000 (15:35 +0100)
commitd165033d9b3225de1b56333f23394bf3bc08fbe6
treef88cceed309ff11b4ca16d68d2f890228fc862a0
parent7cd83cfecd39d68ec4179aaa59a3e207825c151c
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: fac014f25bc5 (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>
drivers/gpio/gpiolib-cdev.h
drivers/gpio/gpiolib.c