Message ID | 20181128165756.20908-2-hdegoede@redhat.com |
---|---|
State | New |
Headers | show |
Series | [v2,1/2] gpiolib-acpi: Only defer request_irq for GpioInt ACPI event handlers | expand |
On Wed, Nov 28, 2018 at 05:57:56PM +0100, Hans de Goede wrote: > acpi_gpiochip_alloc_event only continues allocating an event and adding > it to the list if gpiochip_request_own_desc does not return an error. > So events with an error desc are never placed on the events list and this > check is really not necessary. > > Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
On Wed, Nov 28, 2018 at 5:58 PM Hans de Goede <hdegoede@redhat.com> wrote: > acpi_gpiochip_alloc_event only continues allocating an event and adding > it to the list if gpiochip_request_own_desc does not return an error. > So events with an error desc are never placed on the events list and this > check is really not necessary. > > Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > Signed-off-by: Hans de Goede <hdegoede@redhat.com> This doesn't apply cleanly other than on top of the patch sent for fixes. So I include it with the fixes. No big deal. I think. Yours, Linus Walleij
Hi, On 07-12-18 11:04, Linus Walleij wrote: > On Wed, Nov 28, 2018 at 5:58 PM Hans de Goede <hdegoede@redhat.com> wrote: > >> acpi_gpiochip_alloc_event only continues allocating an event and adding >> it to the list if gpiochip_request_own_desc does not return an error. >> So events with an error desc are never placed on the events list and this >> check is really not necessary. >> >> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> >> Signed-off-by: Hans de Goede <hdegoede@redhat.com> > > This doesn't apply cleanly other than on top of the patch > sent for fixes. > > So I include it with the fixes. No big deal. I think. Yes, that is fine. Thank you. Regards, Hans
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index 7f93954c58ea..091a3784720d 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c @@ -357,8 +357,6 @@ void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) mutex_unlock(&acpi_gpio_deferred_req_irqs_lock); list_for_each_entry_safe_reverse(event, ep, &acpi_gpio->events, node) { - struct gpio_desc *desc; - if (event->irq_requested) { if (event->irq_is_wake) disable_irq_wake(event->irq); @@ -366,11 +364,8 @@ void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) free_irq(event->irq, event); } - desc = event->desc; - if (WARN_ON(IS_ERR(desc))) - continue; gpiochip_unlock_as_irq(chip, event->pin); - gpiochip_free_own_desc(desc); + gpiochip_free_own_desc(event->desc); list_del(&event->node); kfree(event); }
acpi_gpiochip_alloc_event only continues allocating an event and adding it to the list if gpiochip_request_own_desc does not return an error. So events with an error desc are never placed on the events list and this check is really not necessary. Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> --- drivers/gpio/gpiolib-acpi.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)