Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 86252329 authored by Hans de Goede's avatar Hans de Goede Committed by Linus Walleij
Browse files

gpiolib-acpi: Remove unnecessary WARN_ON from acpi_gpiochip_free_interrupts



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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Acked-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent bfeffd15
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -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);
	}