[PATCH v7 09/15] gpiolib: regmap: add gpio_regmap_get_chip()

zl020895 zl020895 at 163.com
Tue Sep 15 21:49:46 PDT 2026


Hi Andy, 

Thanks for the review.

It isn't; that was leftover from dropping girq. v8 will restore the
original attach code. The real addition is gpio_regmap_get_chip(), so
PL061 can create its irq domain after register.

Best regards,
Long Zhao

At 2026-09-15 23:30:38, "Andy Shevchenko" <andriy.shevchenko at linux.intel.com> wrote:
>On Tue, Sep 15, 2026 at 07:15:39PM +0800, Long Zhao via B4 Relay wrote:
>
>> Let drivers that implement a custom irqchip retrieve the gpio_chip
>> after registration. Attach a caller-provided irq_domain only when it
>> is present.
>
>...
>
>>  struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config)
>>  {
>> -	struct irq_domain *irq_domain;
>>  	struct gpio_regmap *gpio;
>>  	struct gpio_chip *chip;
>>  	int ret;
>
>>  #ifdef CONFIG_REGMAP_IRQ
>>  	if (config->regmap_irq_chip) {
>> +		struct irq_domain *irq_domain;
>> +
>>  		gpio->regmap_irq_line = config->regmap_irq_line;
>>  		ret = regmap_add_irq_chip_fwnode(dev_fwnode(config->parent), config->regmap,
>>  						 config->regmap_irq_line, config->regmap_irq_flags,
>> @@ -420,12 +427,15 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config
>>  			goto err_remove_gpiochip;
>>  
>>  		irq_domain = regmap_irq_get_domain(gpio->irq_chip_data);
>> +		if (irq_domain) {
>> +			ret = gpiochip_irqchip_add_domain(chip, irq_domain);
>> +			if (ret)
>> +				goto err_remove_gpiochip;
>> +		}
>>  	} else
>>  #endif
>> -	irq_domain = config->irq_domain;
>> -
>> -	if (irq_domain) {
>> -		ret = gpiochip_irqchip_add_domain(chip, irq_domain);
>> +	if (config->irq_domain) {
>> +		ret = gpiochip_irqchip_add_domain(chip, config->irq_domain);
>>  		if (ret)
>>  			goto err_remove_gpiochip;
>>  	}
>
>I do not understand how it's different from the original one. Can you elaborate?
>
>-- 
>With Best Regards,
>Andy Shevchenko
>


More information about the linux-arm-kernel mailing list