diff options
Diffstat (limited to 'drivers/gpio/gpiolib-acpi.c')
-rw-r--r-- | drivers/gpio/gpiolib-acpi.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index 58ece201b8e6..72a4b326fd0d 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c | |||
@@ -653,14 +653,17 @@ int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index) | |||
653 | { | 653 | { |
654 | int idx, i; | 654 | int idx, i; |
655 | unsigned int irq_flags; | 655 | unsigned int irq_flags; |
656 | int ret = -ENOENT; | ||
656 | 657 | ||
657 | for (i = 0, idx = 0; idx <= index; i++) { | 658 | for (i = 0, idx = 0; idx <= index; i++) { |
658 | struct acpi_gpio_info info; | 659 | struct acpi_gpio_info info; |
659 | struct gpio_desc *desc; | 660 | struct gpio_desc *desc; |
660 | 661 | ||
661 | desc = acpi_get_gpiod_by_index(adev, NULL, i, &info); | 662 | desc = acpi_get_gpiod_by_index(adev, NULL, i, &info); |
662 | if (IS_ERR(desc)) | 663 | if (IS_ERR(desc)) { |
664 | ret = PTR_ERR(desc); | ||
663 | break; | 665 | break; |
666 | } | ||
664 | if (info.gpioint && idx++ == index) { | 667 | if (info.gpioint && idx++ == index) { |
665 | int irq = gpiod_to_irq(desc); | 668 | int irq = gpiod_to_irq(desc); |
666 | 669 | ||
@@ -679,7 +682,7 @@ int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index) | |||
679 | } | 682 | } |
680 | 683 | ||
681 | } | 684 | } |
682 | return -ENOENT; | 685 | return ret; |
683 | } | 686 | } |
684 | EXPORT_SYMBOL_GPL(acpi_dev_gpio_irq_get); | 687 | EXPORT_SYMBOL_GPL(acpi_dev_gpio_irq_get); |
685 | 688 | ||