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

gpiolib: acpi: Make acpi_gpiochip_alloc_event always return AE_OK



acpi_gpiochip_alloc_event is used to loop over all _AEI resources, if
we fail to bind an event handler to one of them, that is not a reason to
not try the other resources.

This commit modifies acpi_gpiochip_alloc_event to always return AE_OK,
so that we will always try to add an event handler for all _AEI resources.

Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20191114102600.34558-2-hdegoede@redhat.com


Acked-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 787b64a4
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -194,6 +194,7 @@ static void acpi_gpiochip_request_irqs(struct acpi_gpio_chip *acpi_gpio)
		acpi_gpiochip_request_irq(acpi_gpio, event);
}

/* Always returns AE_OK so that we keep looping over the resources */
static acpi_status acpi_gpiochip_alloc_event(struct acpi_resource *ares,
					     void *context)
{
@@ -233,7 +234,7 @@ static acpi_status acpi_gpiochip_alloc_event(struct acpi_resource *ares,
		dev_err(chip->parent,
			"Failed to request GPIO for pin 0x%04X, err %ld\n",
			pin, PTR_ERR(desc));
		return AE_ERROR;
		return AE_OK;
	}

	ret = gpiochip_lock_as_irq(chip, pin);
@@ -293,7 +294,7 @@ fail_unlock_irq:
fail_free_desc:
	gpiochip_free_own_desc(desc);

	return AE_ERROR;
	return AE_OK;
}

/**