[v1,3/8] gpio: bcm-kona: Don't shadow error code of gpiochip_lock_as_irq()

Message ID 20180730123837.3936-3-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: Ray Jui <rjui@broadcom.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Scott Branden <sbranden@broadcom.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-bcm-kona.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Florian Fainelli July 30, 2018, 4:26 p.m. | #1
On 07/30/2018 05:38 AM, Andy Shevchenko 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: Ray Jui <rjui@broadcom.com>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: Scott Branden <sbranden@broadcom.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Linus Walleij Aug. 5, 2018, 12:11 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,
> do not shadow them by -EINVAL and let caller to decide.
>
> No functional change intended.
>
> Cc: Ray Jui <rjui@broadcom.com>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: Scott Branden <sbranden@broadcom.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Patch applied with Florian'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-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c
index 00272fa7cc4f..d0707fc23afd 100644
--- a/drivers/gpio/gpio-bcm-kona.c
+++ b/drivers/gpio/gpio-bcm-kona.c
@@ -485,12 +485,14 @@  static void bcm_kona_gpio_irq_handler(struct irq_desc *desc)
 static int bcm_kona_gpio_irq_reqres(struct irq_data *d)
 {
 	struct bcm_kona_gpio *kona_gpio = irq_data_get_irq_chip_data(d);
+	int ret;
 
-	if (gpiochip_lock_as_irq(&kona_gpio->gpio_chip, d->hwirq)) {
+	ret = gpiochip_lock_as_irq(&kona_gpio->gpio_chip, d->hwirq);
+	if (ret) {
 		dev_err(kona_gpio->gpio_chip.parent,
 			"unable to lock HW IRQ %lu for IRQ\n",
 			d->hwirq);
-		return -EINVAL;
+		return ret;
 	}
 	return 0;
 }