diff options
author | Mathias Nyman <mathias.nyman@linux.intel.com> | 2013-02-04 04:32:22 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-02-04 15:41:47 -0500 |
commit | 1107ca104f0331627f6446bfefa2d4b0e673db18 (patch) | |
tree | c965296f42b8428b8b137f2c2f379f2abadba6ee /drivers | |
parent | de0ccf788147440eee2383c74408080f3ff0a43b (diff) |
gpiolib-acpi: Fix error checks in interrupt requesting
Print error message if requesting an interrupt fails.
Use int instead of unsigned for interrupts in case of error values
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpio/gpiolib-acpi.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index 54ce2269ed25..a063eb04b6ce 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c | |||
@@ -83,7 +83,8 @@ void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) | |||
83 | struct acpi_resource *res; | 83 | struct acpi_resource *res; |
84 | acpi_handle handle, ev_handle; | 84 | acpi_handle handle, ev_handle; |
85 | acpi_status status; | 85 | acpi_status status; |
86 | unsigned int pin, irq; | 86 | unsigned int pin; |
87 | int irq, ret; | ||
87 | char ev_name[5]; | 88 | char ev_name[5]; |
88 | 89 | ||
89 | if (!chip->dev || !chip->to_irq) | 90 | if (!chip->dev || !chip->to_irq) |
@@ -126,11 +127,15 @@ void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) | |||
126 | continue; | 127 | continue; |
127 | 128 | ||
128 | /* Assume BIOS sets the triggering, so no flags */ | 129 | /* Assume BIOS sets the triggering, so no flags */ |
129 | devm_request_threaded_irq(chip->dev, irq, NULL, | 130 | ret = devm_request_threaded_irq(chip->dev, irq, NULL, |
130 | acpi_gpio_irq_handler, | 131 | acpi_gpio_irq_handler, |
131 | 0, | 132 | 0, |
132 | "GPIO-signaled-ACPI-event", | 133 | "GPIO-signaled-ACPI-event", |
133 | ev_handle); | 134 | ev_handle); |
135 | if (ret) | ||
136 | dev_err(chip->dev, | ||
137 | "Failed to request IRQ %d ACPI event handler\n", | ||
138 | irq); | ||
134 | } | 139 | } |
135 | } | 140 | } |
136 | EXPORT_SYMBOL(acpi_gpiochip_request_interrupts); | 141 | EXPORT_SYMBOL(acpi_gpiochip_request_interrupts); |