Skip to content

Commit 3f86a7e

Browse files
jwrdegoedelinusw
authored andcommitted
gpiolib: acpi: Print pin number on acpi_gpiochip_alloc_event errors
Print pin number and error-code on acpi_gpiochip_alloc_event errors, to help debugging these. Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Mika Westerberg <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent b27f300 commit 3f86a7e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

drivers/gpio/gpiolib-acpi.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,19 +230,25 @@ static acpi_status acpi_gpiochip_alloc_event(struct acpi_resource *ares,
230230
desc = gpiochip_request_own_desc(chip, pin, "ACPI:Event",
231231
GPIO_ACTIVE_HIGH, GPIOD_IN);
232232
if (IS_ERR(desc)) {
233-
dev_err(chip->parent, "Failed to request GPIO\n");
233+
dev_err(chip->parent,
234+
"Failed to request GPIO for pin 0x%04X, err %ld\n",
235+
pin, PTR_ERR(desc));
234236
return AE_ERROR;
235237
}
236238

237239
ret = gpiochip_lock_as_irq(chip, pin);
238240
if (ret) {
239-
dev_err(chip->parent, "Failed to lock GPIO as interrupt\n");
241+
dev_err(chip->parent,
242+
"Failed to lock GPIO pin 0x%04X as interrupt, err %d\n",
243+
pin, ret);
240244
goto fail_free_desc;
241245
}
242246

243247
irq = gpiod_to_irq(desc);
244248
if (irq < 0) {
245-
dev_err(chip->parent, "Failed to translate GPIO to IRQ\n");
249+
dev_err(chip->parent,
250+
"Failed to translate GPIO pin 0x%04X to IRQ, err %d\n",
251+
pin, irq);
246252
goto fail_unlock_irq;
247253
}
248254

0 commit comments

Comments
 (0)