mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-27 06:04:23 +08:00
1f5eb8b17f
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: d143493c01
(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>
14 lines
284 B
C
14 lines
284 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef GPIOLIB_CDEV_H
|
|
#define GPIOLIB_CDEV_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
struct gpio_device;
|
|
|
|
int gpiolib_cdev_register(struct gpio_device *gdev, dev_t devt);
|
|
void gpiolib_cdev_unregister(struct gpio_device *gdev);
|
|
|
|
#endif /* GPIOLIB_CDEV_H */
|