[v1,1/8] pinctrl: intel: Don't shadow error code of gpiochip_lock_as_irq()

Message ID 20180730123837.3936-1-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: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/pinctrl/intel/pinctrl-intel.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Mika Westerberg Aug. 1, 2018, 7:56 a.m. | #1
On Mon, Jul 30, 2018 at 03:38:30PM +0300, 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: Mika Westerberg <mika.westerberg@linux.intel.com>

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
--
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. 3, 2018, 5:43 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: Mika Westerberg <mika.westerberg@linux.intel.com>
> Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Patch applied with Mika'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/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c
index d023b64825d0..62b009b27eda 100644
--- a/drivers/pinctrl/intel/pinctrl-intel.c
+++ b/drivers/pinctrl/intel/pinctrl-intel.c
@@ -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;