Skip to content

Commit

Permalink
gpiolib-acpi: Remove unnecessary WARN_ON from acpi_gpiochip_free_inte…
Browse files Browse the repository at this point in the history
…rrupts

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>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Hans de Goede authored and Linus Walleij committed Jan 7, 2019
1 parent bfeffd1 commit 8625232
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/gpio/gpiolib-acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,20 +357,15 @@ 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);

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);
}
Expand Down

0 comments on commit 8625232

Please sign in to comment.