mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] gpiolib: regmap: document gpio_regmap_get_chip()
@ 2026-09-21 12:13 Long Zhao via B4 Relay
  2026-09-24 21:06 ` Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Long Zhao via B4 Relay @ 2026-09-21 12:13 UTC (permalink / raw)
  To: Michael Walle, Linus Walleij, Bartosz Golaszewski
  Cc: Andy Shevchenko, linux-gpio, linux-kernel, Long Zhao

From: Long Zhao <longzhao@ambarella.com>

Add kernel-doc for the new helper and state that it is only for GPIO
controller drivers, not for GPIO consumers.

This is a follow-up to v8 09/18.

Signed-off-by: Long Zhao <longzhao@ambarella.com>
---
Follow-up to v8 09/18:
https://lore.kernel.org/r/20260921-cv75-v5-v8-9-42de52d636a0@ambarella.com
Add kernel-doc for gpio_regmap_get_chip().
---
 drivers/gpio/gpio-regmap.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c
index 21e0993b89e2..8ba7263729a8 100644
--- a/drivers/gpio/gpio-regmap.c
+++ b/drivers/gpio/gpio-regmap.c
@@ -295,6 +295,19 @@ void *gpio_regmap_get_drvdata(struct gpio_regmap *gpio)
 }
 EXPORT_SYMBOL_GPL(gpio_regmap_get_drvdata);
 
+/**
+ * gpio_regmap_get_chip() - Return the gpio_chip of a gpio-regmap instance
+ * @gpio: Handle returned by gpio_regmap_register()
+ *
+ * GPIO controller drivers that register through gpio-regmap but still
+ * implement a custom irqchip can use this to obtain the associated
+ * gpio_chip after registration.
+ *
+ * This must not be used outside of GPIO controller driver context,
+ * for example not by GPIO consumers.
+ *
+ * Return: Pointer to the embedded struct gpio_chip.
+ */
 struct gpio_chip *gpio_regmap_get_chip(struct gpio_regmap *gpio)
 {
 	return &gpio->gpio_chip;

---
base-commit: 4b54e79ffe453959073b81638c3ac6c04177639e
change-id: 20260921-gpio-doc-followup-8289cca93b2a

Best regards,
--  
Long Zhao <longzhao@ambarella.com>



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

* Re: [PATCH] gpiolib: regmap: document gpio_regmap_get_chip()
  2026-09-21 12:13 [PATCH] gpiolib: regmap: document gpio_regmap_get_chip() Long Zhao via B4 Relay
@ 2026-09-24 21:06 ` Andy Shevchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2026-09-24 21:06 UTC (permalink / raw)
  To: longzhao
  Cc: Michael Walle, Linus Walleij, Bartosz Golaszewski, linux-gpio,
	linux-kernel

On Mon, Sep 21, 2026 at 08:13:33PM +0800, Long Zhao via B4 Relay wrote:

> Add kernel-doc for the new helper and state that it is only for GPIO
> controller drivers, not for GPIO consumers.
> 
> This is a follow-up to v8 09/18.

Then fold it locally in be sent in v9. However as far as I understand your
small chant with Michael that the new approach should not use it at all.

-- 
With Best Regards,
Andy Shevchenko



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

end of thread, other threads:[~2026-09-24 21:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-21 12:13 [PATCH] gpiolib: regmap: document gpio_regmap_get_chip() Long Zhao via B4 Relay
2026-09-24 21:06 ` Andy Shevchenko

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

all inboxes | Powered by JetHome®