diff options
| author | Ivan T. Ivanov <ivan.ivanov@linaro.org> | 2015-04-09 11:18:37 -0400 |
|---|---|---|
| committer | Linus Walleij <linus.walleij@linaro.org> | 2015-04-28 08:52:50 -0400 |
| commit | 4e637ac212b63f4b5dd1da626aca34ffcbfd5daa (patch) | |
| tree | 962103f5cd0461648830dcfe42d270393209f0ac /drivers | |
| parent | dc391502fdbf97a9cabdc58ba8c915175383f681 (diff) | |
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')
| -rw-r--r-- | drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 9 |
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, | |||
| 577 | 577 | ||
| 578 | if (pad->input_enabled) { | 578 | if (pad->input_enabled) { |
| 579 | ret = pmic_mpp_read(state, pad, PMIC_MPP_REG_RT_STS); | 579 | ret = pmic_mpp_read(state, pad, PMIC_MPP_REG_RT_STS); |
| 580 | if (!ret) { | 580 | if (ret < 0) |
| 581 | ret &= PMIC_MPP_REG_RT_STS_VAL_MASK; | 581 | return; |
| 582 | pad->out_value = ret; | 582 | |
| 583 | } | 583 | ret &= PMIC_MPP_REG_RT_STS_VAL_MASK; |
| 584 | pad->out_value = ret; | ||
| 584 | } | 585 | } |
| 585 | 586 | ||
| 586 | seq_printf(s, " %-4s", pad->output_enabled ? "out" : "in"); | 587 | seq_printf(s, " %-4s", pad->output_enabled ? "out" : "in"); |
