gpiochip: expose gpiochip set data to be able to use it with a an usb gpio expander for example.
PATCH 1/1 gpiochip: expose gpiochip set data to be able to use it with a an usb gpio expander for example.
From: Anis Chali <[email protected]>
Signed-off-by Anis Chali <[email protected]>
--- drivers/gpio/gpiolib.c | 8 +++++++- include/linux/gpio/driver.h | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-)
drivers/gpio/gpiolib.c +7 -1
@@ -900,10 +900,16 @@ static void gpiochip_setup_devs(void) } } -static void gpiochip_set_data (struct gpio_chip *gc,void *data) +/** +* gpiochip_set_data() - set per-subdriver data for the chip +* @gc: GPIO chip +* @data: Data for GPIO chip +*/ +void gpiochip_set_data (struct gpio_chip *gc,void *data) { gc->gpiodev->data = data; } +EXPORT_SYMBOL_GPL (gpiochip_set_data);/** * gpiochip_get_data() - get per-subdriver data for the chip
include/linux/gpio/driver.h +3 -0
@@ -717,6 +717,9 @@ const unsigned long *gpiochip_query_valid_mask(const struct gpio_chip *gc);/* get driver data */ void *gpiochip_get_data (struct gpio_chip *gc); +/* gpiochip set data */ +void gpiochip_set_data (struct gpio_chip *gc,void *data); +struct bgpio_pdata {const char *label;int base;
Signature · 1 line
2.49.0
Quoted 5 lines · On Mon, May 19, 2025 at 6:18 AM <[email protected]> wrote:
From: Anis Chali <[email protected]>
Signed-off-by Anis Chali <[email protected]>---
I will definitely need a more elaborate explanation of what you're trying to do and why. We don't export symbols that have no users in the kernel so I would at least expect a second patch adding it.
Bart