[v1,2/8] gpiolib: Don't shadow error code of gpiochip_lock_as_irq()

Message ID 20180730123837.3936-2-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.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpiolib.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Linus Walleij Aug. 5, 2018, 12:07 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.
>
> 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/gpiolib.c b/drivers/gpio/gpiolib.c
index 464d5ba79f96..1f10a9a8e44e 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1805,16 +1805,18 @@  static const struct irq_domain_ops gpiochip_domain_ops = {
 static int gpiochip_irq_reqres(struct irq_data *d)
 {
 	struct gpio_chip *chip = irq_data_get_irq_chip_data(d);
+	int ret;
 
 	if (!try_module_get(chip->gpiodev->owner))
 		return -ENODEV;
 
-	if (gpiochip_lock_as_irq(chip, d->hwirq)) {
+	ret = gpiochip_lock_as_irq(chip, d->hwirq);
+	if (ret) {
 		chip_err(chip,
 			"unable to lock HW IRQ %lu for IRQ\n",
 			d->hwirq);
 		module_put(chip->gpiodev->owner);
-		return -EINVAL;
+		return ret;
 	}
 	return 0;
 }