Browse Source

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>
Ivan T. Ivanov 10 years ago
parent
commit
4e637ac212
1 changed files with 5 additions and 4 deletions
  1. 5 4
      drivers/pinctrl/qcom/pinctrl-spmi-mpp.c

+ 5 - 4
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) {
 		if (pad->input_enabled) {
 			ret = pmic_mpp_read(state, pad, PMIC_MPP_REG_RT_STS);
 			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");
 		seq_printf(s, " %-4s", pad->output_enabled ? "out" : "in");