linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: linux-gpio@vger.kernel.org, Alexandre Courbot <acourbot@nvidia.com>
Cc: "Linus Walleij" <linus.walleij@linaro.org>,
	"Björn Andersson" <bjorn@kryo.se>
Subject: [PATCH] pinctrl: qcom: fix up errorpath
Date: Tue,  5 Jan 2016 10:26:09 +0100	[thread overview]
Message-ID: <1451985969-17717-1-git-send-email-linus.walleij@linaro.org> (raw)

This fixes up:
commit 464231fb1fb1360399a2eb11479c47e39facb030
"pinctrl: ssbi-gpio: Be sure to clamp return value"
commit b9164f049339006fafe8a52396e0f1997552214a
"gpio: ssbi-mpp: Be sure to clamp return value"
as I managed to screw up some of the logic when clamping
the return values.

Cc: Björn Andersson <bjorn@kryo.se>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c | 4 ++--
 drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
index 394ca34bec4a..7bea0df06fb1 100644
--- a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
+++ b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
@@ -487,10 +487,10 @@ static int pm8xxx_gpio_get(struct gpio_chip *chip, unsigned offset)
 	} else {
 		ret = irq_get_irqchip_state(pin->irq, IRQCHIP_STATE_LINE_LEVEL, &state);
 		if (!ret)
-			ret = state;
+			ret = !!state;
 	}
 
-	return !!ret;
+	return ret;
 }
 
 static void pm8xxx_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
index 23089d541230..629642b73489 100644
--- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
+++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c
@@ -506,9 +506,9 @@ static int pm8xxx_mpp_get(struct gpio_chip *chip, unsigned offset)
 
 	ret = irq_get_irqchip_state(pin->irq, IRQCHIP_STATE_LINE_LEVEL, &state);
 	if (!ret)
-		ret = state;
+		ret = !!state;
 
-	return !!ret;
+	return ret;
 }
 
 static void pm8xxx_mpp_set(struct gpio_chip *chip, unsigned offset, int value)
-- 
2.4.3

--
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

             reply	other threads:[~2016-01-05  9:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-05  9:26 Linus Walleij [this message]
2016-01-05 17:21 ` [PATCH] pinctrl: qcom: fix up errorpath Bjorn Andersson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1451985969-17717-1-git-send-email-linus.walleij@linaro.org \
    --to=linus.walleij@linaro.org \
    --cc=acourbot@nvidia.com \
    --cc=bjorn@kryo.se \
    --cc=linux-gpio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).