mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	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>
		
	
			
		
			
				
	
	
		
			13 lines
		
	
	
	
		
			284 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			13 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 */
 |