[v1,4/8] gpio: dwapb: Don't shadow error code of gpiochip_lock_as_irq()

Message ID 20180730123837.3936-4-andriy.shevchenko@linux.intel.com
State New
Headers show
Series
  • [v1,1/8] pinctrl: intel: Don't shadow error code of gpiochip_lock_as_irq()
Related show

Commit Message

Andy Shevchenko July 30, 2018, 12:38 p.m.
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: Hoan Tran <hotran@apm.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-dwapb.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Linus Walleij Aug. 5, 2018, 12:12 p.m. | #1
On Mon, Jul 30, 2018 at 2:38 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> 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: Hoan Tran <hotran@apm.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Patch applied.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c
index 7a2de3de6571..28da700f5f52 100644
--- a/drivers/gpio/gpio-dwapb.c
+++ b/drivers/gpio/gpio-dwapb.c
@@ -255,11 +255,13 @@  static int dwapb_irq_reqres(struct irq_data *d)
 	struct irq_chip_generic *igc = irq_data_get_irq_chip_data(d);
 	struct dwapb_gpio *gpio = igc->private;
 	struct gpio_chip *gc = &gpio->ports[0].gc;
+	int ret;
 
-	if (gpiochip_lock_as_irq(gc, irqd_to_hwirq(d))) {
+	ret = gpiochip_lock_as_irq(gc, irqd_to_hwirq(d));
+	if (ret) {
 		dev_err(gpio->dev, "unable to lock HW IRQ %lu for IRQ\n",
 			irqd_to_hwirq(d));
-		return -EINVAL;
+		return ret;
 	}
 	return 0;
 }