[-next] pinctrl: qcom: spmi-mpp: Fix err handling of pmic_mpp_set_mux
diff mbox series

Message ID 1537408698-196297-1-git-send-email-yuehaibing@huawei.com
State New
Headers show
Series
  • [-next] pinctrl: qcom: spmi-mpp: Fix err handling of pmic_mpp_set_mux
Related show

Commit Message

YueHaibing Sept. 20, 2018, 1:58 a.m. UTC
'ret' should be returned while pmic_mpp_write_mode_ctl fails. 

Fixes: 0e948042c420 ("pinctrl: qcom: spmi-mpp: Implement support for sink mode")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Linus Walleij Sept. 21, 2018, 3:18 p.m. UTC | #1
On Wed, Sep 19, 2018 at 6:48 PM YueHaibing <yuehaibing@huawei.com> wrote:

> 'ret' should be returned while pmic_mpp_write_mode_ctl fails.
>
> Fixes: 0e948042c420 ("pinctrl: qcom: spmi-mpp: Implement support for sink mode")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Patch applied.

Yours,
Linus Walleij

Patch
diff mbox series

diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
index 98f6f40..d6ddc47 100644
--- a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
+++ b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
@@ -319,6 +319,8 @@  static int pmic_mpp_set_mux(struct pinctrl_dev *pctldev, unsigned function,
 	pad->function = function;
 
 	ret = pmic_mpp_write_mode_ctl(state, pad);
+	if (ret < 0)
+		return ret;
 
 	val = pad->is_enabled << PMIC_MPP_REG_MASTER_EN_SHIFT;