Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Input: gpio_keys - fall back to platform_get_irq() for interrupt-only keys

To allow transitioning away from gpio-keys platform data attempt to
retrieve IRQ for interrupt-only keys using platform_get_irq_optional()
if interrupt is not specified in platform data.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+12 -5
+12 -5
drivers/input/keyboard/gpio_keys.c
··· 616 616 break; 617 617 } 618 618 } else { 619 - if (!button->irq) { 620 - dev_err(dev, "Found button without gpio or irq\n"); 621 - return -EINVAL; 622 - } 619 + if (button->irq) { 620 + bdata->irq = button->irq; 621 + } else { 622 + irq = platform_get_irq_optional(pdev, idx); 623 + if (irq < 0) { 624 + error = irq; 625 + return dev_err_probe(dev, error, 626 + "Unable to determine IRQ# for button #%d", 627 + idx); 628 + } 623 629 624 - bdata->irq = button->irq; 630 + bdata->irq = irq; 631 + } 625 632 626 633 if (button->type && button->type != EV_KEY) { 627 634 dev_err(dev, "Only EV_KEY allowed for IRQ buttons.\n");