[v1,7/8] gpio: uniphier: Bail out on gpiochip_lock_as_irq() error

Message ID 20180730123837.3936-7-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,
bail out if it fails with corresponding returned code.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-uniphier.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Masahiro Yamada July 31, 2018, 1:52 a.m. | #1
2018-07-30 21:38 GMT+09:00 Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
> gpiochip_lock_as_irq() may return a few error codes,
> bail out if it fails with corresponding returned code.
>
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---


Acked-by: Masahiro Yamada <yamada.masahiro@socionext.com>


Thanks!



>  drivers/gpio/gpio-uniphier.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-uniphier.c b/drivers/gpio/gpio-uniphier.c
> index 58faeb1cef63..7fdac9060979 100644
> --- a/drivers/gpio/gpio-uniphier.c
> +++ b/drivers/gpio/gpio-uniphier.c
> @@ -310,8 +310,7 @@ static int uniphier_gpio_irq_domain_activate(struct irq_domain *domain,
>         struct uniphier_gpio_priv *priv = domain->host_data;
>         struct gpio_chip *chip = &priv->chip;
>
> -       gpiochip_lock_as_irq(chip, data->hwirq + UNIPHIER_GPIO_IRQ_OFFSET);
> -       return 0;
> +       return gpiochip_lock_as_irq(chip, data->hwirq + UNIPHIER_GPIO_IRQ_OFFSET);
>  }
>
>  static void uniphier_gpio_irq_domain_deactivate(struct irq_domain *domain,
> --
> 2.18.0
>
> --
> 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
Linus Walleij Aug. 5, 2018, 12:20 p.m. | #2
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,
> bail out if it fails with corresponding returned code.
>
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Patch applied with Masahiro's ACK.

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-uniphier.c b/drivers/gpio/gpio-uniphier.c
index 58faeb1cef63..7fdac9060979 100644
--- a/drivers/gpio/gpio-uniphier.c
+++ b/drivers/gpio/gpio-uniphier.c
@@ -310,8 +310,7 @@  static int uniphier_gpio_irq_domain_activate(struct irq_domain *domain,
 	struct uniphier_gpio_priv *priv = domain->host_data;
 	struct gpio_chip *chip = &priv->chip;
 
-	gpiochip_lock_as_irq(chip, data->hwirq + UNIPHIER_GPIO_IRQ_OFFSET);
-	return 0;
+	return gpiochip_lock_as_irq(chip, data->hwirq + UNIPHIER_GPIO_IRQ_OFFSET);
 }
 
 static void uniphier_gpio_irq_domain_deactivate(struct irq_domain *domain,