From: Dan Carpenter <dan.carpenter@oracle.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
linux-renesas-soc@vger.kernel.org, linux-gpio@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH] pinctrl: sh-pfc: Unlock on error in sh_pfc_func_set_mux()
Date: Tue, 27 Aug 2019 12:39:27 +0300 [thread overview]
Message-ID: <20190827093927.GB8443@mwanda> (raw)
We need to unlock and enable IRQs before we return on this error path.
Fixes: 8a0cc47ccc7c ("pinctrl: sh-pfc: Rollback to mux if required when the gpio is freed")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/pinctrl/sh-pfc/pinctrl.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/sh-pfc/pinctrl.c b/drivers/pinctrl/sh-pfc/pinctrl.c
index 99f4ebd69861..212a4a9c3a8f 100644
--- a/drivers/pinctrl/sh-pfc/pinctrl.c
+++ b/drivers/pinctrl/sh-pfc/pinctrl.c
@@ -361,8 +361,10 @@ static int sh_pfc_func_set_mux(struct pinctrl_dev *pctldev, unsigned selector,
* This driver cannot manage both gpio and mux when the gpio
* pin is already enabled. So, this function fails.
*/
- if (cfg->gpio_enabled)
- return -EBUSY;
+ if (cfg->gpio_enabled) {
+ ret = -EBUSY;
+ goto done;
+ }
ret = sh_pfc_config_mux(pfc, grp->mux[i], PINMUX_TYPE_FUNCTION);
if (ret < 0)
--
2.20.1
next reply other threads:[~2019-08-27 9:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-27 9:39 Dan Carpenter [this message]
2019-08-27 9:49 ` [PATCH] pinctrl: sh-pfc: Unlock on error in sh_pfc_func_set_mux() Geert Uytterhoeven
2019-08-27 9:54 ` Yoshihiro Shimoda
2019-09-12 12:01 ` Linus Walleij
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=20190827093927.GB8443@mwanda \
--to=dan.carpenter@oracle.com \
--cc=geert+renesas@glider.be \
--cc=kernel-janitors@vger.kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=yoshihiro.shimoda.uh@renesas.com \
/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