summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/qcom
diff options
context:
space:
mode:
authorIvan T. Ivanov <ivan.ivanov@linaro.org>2015-04-09 17:18:37 +0200
committerLinus Walleij <linus.walleij@linaro.org>2015-04-28 14:52:50 +0200
commit4e637ac212b63f4b5dd1da626aca34ffcbfd5daa (patch)
tree962103f5cd0461648830dcfe42d270393209f0ac /drivers/pinctrl/qcom
parentpinctrl: qcom-spmi: Fix pin direction configuration (diff)
downloadlinux-4e637ac212b63f4b5dd1da626aca34ffcbfd5daa.tar.xz
linux-4e637ac212b63f4b5dd1da626aca34ffcbfd5daa.zip
pinctrl: qcom-spmi-mpp: Fix input value report
Fix interpretation of the pmic_mpp_read() return code, negative value means an error. Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/qcom')
-rw-r--r--drivers/pinctrl/qcom/pinctrl-spmi-mpp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
index 890df16353b3..211b942ad6d5 100644
--- a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
+++ b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
@@ -577,10 +577,11 @@ static void pmic_mpp_config_dbg_show(struct pinctrl_dev *pctldev,
if (pad->input_enabled) {
ret = pmic_mpp_read(state, pad, PMIC_MPP_REG_RT_STS);
- if (!ret) {
- ret &= PMIC_MPP_REG_RT_STS_VAL_MASK;
- pad->out_value = ret;
- }
+ if (ret < 0)
+ return;
+
+ ret &= PMIC_MPP_REG_RT_STS_VAL_MASK;
+ pad->out_value = ret;
}
seq_printf(s, " %-4s", pad->output_enabled ? "out" : "in");