Re:Re: [PATCH v8 09/18] gpiolib: regmap: add gpio_regmap_get_chip()
From: zl020895
Date: Mon Sep 21 2026 - 09:04:04 EST
Hi Bart,
Done, sent as a follow-up:
https://lore.kernel.org/all/20260921-gpio-doc-followup-v1-1-618738124f4c@xxxxxxxxxxxxx/
Best regards,
Long Zhao
At 2026-09-21 18:35:08, "Bartosz Golaszewski" <brgl@xxxxxxxxxx> wrote:
>On Mon, 21 Sep 2026 06:23:28 +0200, Long Zhao via B4 Relay
><devnull+longzhao.ambarella.com@xxxxxxxxxx> said:
>> From: Long Zhao <longzhao@xxxxxxxxxxxxx>
>>
>> Let drivers that implement a custom irqchip retrieve the gpio_chip
>> after registration.
>>
>> Signed-off-by: Long Zhao <longzhao@xxxxxxxxxxxxx>
>> ---
>> drivers/gpio/gpio-regmap.c | 6 ++++++
>> include/linux/gpio/regmap.h | 1 +
>> 2 files changed, 7 insertions(+)
>>
>> diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c
>> index fbd4c753525a..21e0993b89e2 100644
>> --- a/drivers/gpio/gpio-regmap.c
>> +++ b/drivers/gpio/gpio-regmap.c
>> @@ -295,6 +295,12 @@ void *gpio_regmap_get_drvdata(struct gpio_regmap *gpio)
>> }
>> EXPORT_SYMBOL_GPL(gpio_regmap_get_drvdata);
>>
>> +struct gpio_chip *gpio_regmap_get_chip(struct gpio_regmap *gpio)
>> +{
>> + return &gpio->gpio_chip;
>> +}
>> +EXPORT_SYMBOL_GPL(gpio_regmap_get_chip);
>
>Please provide a kernel doc for all public APIs. It should explain that this
>must not be used outside of a GPIO controller driver context.
>
>Bart