Skip to content

Commit

Permalink
pinctrl: intel: Don't shadow error code of gpiochip_lock_as_irq()
Browse files Browse the repository at this point in the history
gpiochip_lock_as_irq() may return a few error codes,
do not shadow them by -EINVAL and let caller to decide.

No functional change intended.

Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Andy Shevchenko authored and Linus Walleij committed Aug 3, 2018
1 parent b5031b7 commit cb85d2b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/pinctrl/intel/pinctrl-intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -877,13 +877,15 @@ static int intel_gpio_irq_reqres(struct irq_data *d)
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct intel_pinctrl *pctrl = gpiochip_get_data(gc);
int pin;
int ret;

pin = intel_gpio_to_pin(pctrl, irqd_to_hwirq(d), NULL, NULL);
if (pin >= 0) {
if (gpiochip_lock_as_irq(gc, pin)) {
ret = gpiochip_lock_as_irq(gc, pin);
if (ret) {
dev_err(pctrl->dev, "unable to lock HW IRQ %d for IRQ\n",
pin);
return -EINVAL;
return ret;
}
}
return 0;
Expand Down

0 comments on commit cb85d2b

Please sign in to comment.