diff mbox series

[v2,2/2] gpiolib-acpi: Remove unnecessary WARN_ON from acpi_gpiochip_free_interrupts

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

Commit Message

Hans de Goede Nov. 28, 2018, 4:57 p.m. UTC
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(-)

Comments

Mika Westerberg Nov. 29, 2018, 8:54 a.m. UTC | #1
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>
Linus Walleij Dec. 7, 2018, 10:04 a.m. UTC | #2
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
Hans de Goede Dec. 9, 2018, 11:17 a.m. UTC | #3
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 mbox series

Patch

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