diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2019-08-27 11:39:27 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2019-09-12 13:59:43 +0200 |
commit | a5ea8e99959728fca3d3b811ffda25975121fdf4 (patch) | |
tree | 6e1eaa893e836c2111149bcfc192ed3b9040d746 /drivers/pinctrl | |
parent | Merge tag 'intel-pinctrl-v5.4-2' of git://git.kernel.org/pub/scm/linux/kernel... (diff) | |
download | linux-a5ea8e99959728fca3d3b811ffda25975121fdf4.tar.xz linux-a5ea8e99959728fca3d3b811ffda25975121fdf4.zip |
pinctrl: sh-pfc: Unlock on error in sh_pfc_func_set_mux()
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>
Link: https://lore.kernel.org/r/20190827093927.GB8443@mwanda
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/sh-pfc/pinctrl.c | 6 |
1 files 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) |