Re: [PATCH] gpiolib: fix sysfs when cdev is not selected

From: Bartosz Golaszewski
Date: Thu Nov 05 2020 - 09:37:49 EST


On Thu, Nov 5, 2020 at 11:41 AM Kent Gibson <warthog618@xxxxxxxxx> wrote:
>
> 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@xxxxxxxxxx>
> Signed-off-by: Kent Gibson <warthog618@xxxxxxxxx>

Applied for fixes with Nicolas' tag.

Bartosz