Message ID | 54216EA5.5010506@ti.com |
---|---|
State | Not Applicable, archived |
Headers | show |
On Tue, Sep 23, 2014 at 2:59 PM, Grygorii Strashko <grygorii.strashko@ti.com> wrote: > Now the "irq_base" is used only twice in gpiolib code and below diff should > allow to drop it completely from gpiolib code. > > diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c > index 15cc0bb..81762ed 100644 > --- a/drivers/gpio/gpiolib.c > +++ b/drivers/gpio/gpiolib.c > @@ -524,7 +524,7 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip) > /* Remove all IRQ mappings and delete the domain */ > if (gpiochip->irqdomain) { > for (offset = 0; offset < gpiochip->ngpio; offset++) > - irq_dispose_mapping(gpiochip->irq_base + offset); > + irq_dispose_mapping(irq_find_mapping(gpiochip->irqdomain, offset)); > irq_domain_remove(gpiochip->irqdomain); > } > > not tested. I like the looks of this. Grygorii, can you send a proper, tested patch for this? Thansk! Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
> From: Linus Walleij [mailto:linus.walleij@linaro.org] > > On Tue, Sep 23, 2014 at 2:59 PM, Grygorii Strashko > <grygorii.strashko@ti.com> wrote: > > > Now the "irq_base" is used only twice in gpiolib code and below diff > > should allow to drop it completely from gpiolib code. > > > > diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index > > 15cc0bb..81762ed 100644 > > --- a/drivers/gpio/gpiolib.c > > +++ b/drivers/gpio/gpiolib.c > > @@ -524,7 +524,7 @@ static void gpiochip_irqchip_remove(struct gpio_chip > *gpiochip) > > /* Remove all IRQ mappings and delete the domain */ > > if (gpiochip->irqdomain) { > > for (offset = 0; offset < gpiochip->ngpio; offset++) > > - irq_dispose_mapping(gpiochip->irq_base + offset); > > + > > + irq_dispose_mapping(irq_find_mapping(gpiochip->irqdomain, offset)); > > irq_domain_remove(gpiochip->irqdomain); > > } > > > > not tested. > > I like the looks of this. > > Grygorii, can you send a proper, tested patch for this? Thansk! Could we also remove gpiochip->irq_base if use this solution? It seems gpiochip->irq_base is useless . Thanks
On Thu, Sep 25, 2014 at 9:47 AM, Wang, Yalin <Yalin.Wang@sonymobile.com> wrote: >> From: Linus Walleij [mailto:linus.walleij@linaro.org] >> >> On Tue, Sep 23, 2014 at 2:59 PM, Grygorii Strashko >> <grygorii.strashko@ti.com> wrote: >> >> > Now the "irq_base" is used only twice in gpiolib code and below diff >> > should allow to drop it completely from gpiolib code. >> > >> > diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index >> > 15cc0bb..81762ed 100644 >> > --- a/drivers/gpio/gpiolib.c >> > +++ b/drivers/gpio/gpiolib.c >> > @@ -524,7 +524,7 @@ static void gpiochip_irqchip_remove(struct gpio_chip >> *gpiochip) >> > /* Remove all IRQ mappings and delete the domain */ >> > if (gpiochip->irqdomain) { >> > for (offset = 0; offset < gpiochip->ngpio; offset++) >> > - irq_dispose_mapping(gpiochip->irq_base + offset); >> > + >> > + irq_dispose_mapping(irq_find_mapping(gpiochip->irqdomain, offset)); >> > irq_domain_remove(gpiochip->irqdomain); >> > } >> > >> > not tested. >> >> I like the looks of this. >> >> Grygorii, can you send a proper, tested patch for this? Thansk! > > Could we also remove gpiochip->irq_base if use this solution? > It seems gpiochip->irq_base is useless . I think it is used in some drivers and especially for pin ranges visavis the pin control subsystem, so that could be a complex operation. Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 15cc0bb..81762ed 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -524,7 +524,7 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gpiochip) /* Remove all IRQ mappings and delete the domain */ if (gpiochip->irqdomain) { for (offset = 0; offset < gpiochip->ngpio; offset++) - irq_dispose_mapping(gpiochip->irq_base + offset); + irq_dispose_mapping(irq_find_mapping(gpiochip->irqdomain, offset)); irq_domain_remove(gpiochip->irqdomain); }