The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] gpiochip: expose gpiochip set data to be able to use it with a an usb gpio expander for example.
@ 2025-05-19  4:18 chalianis1
  2025-05-19  8:27 ` Bartosz Golaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: chalianis1 @ 2025-05-19  4:18 UTC (permalink / raw)
  To: linus.walleij, brgl; +Cc: linux-gpio, linux-kernel, Anis Chali

From: Anis Chali <chalianis1@gmail.com>

Signed-off-by: Anis Chali <chalianis1@gmail.com>
---
 drivers/gpio/gpiolib.c      | 8 +++++++-
 include/linux/gpio/driver.h | 3 +++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index cd4fecbb41f2..58d051141f53 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -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
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index 4c0294a9104d..b1206fe42c26 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -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;
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-05-19  8:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-19  4:18 [PATCH] gpiochip: expose gpiochip set data to be able to use it with a an usb gpio expander for example chalianis1
2025-05-19  8:27 ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox