summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Wang <sean.wang@mediatek.com>2018-01-10 00:28:25 +0800
committerLinus Walleij <linus.walleij@linaro.org>2018-01-11 10:43:24 +0100
commit8b3d9cd48d15f34328ec69ecff5ca860e7068e36 (patch)
tree1f4b91fc5beb24a6feeafce5ab889c0fccd37465
parent181cdac02c51a77f9ae497be624edb99056a0a10 (diff)
downloadlinux-stable-8b3d9cd48d15f34328ec69ecff5ca860e7068e36.tar.gz
linux-stable-8b3d9cd48d15f34328ec69ecff5ca860e7068e36.tar.bz2
linux-stable-8b3d9cd48d15f34328ec69ecff5ca860e7068e36.zip
pinctrl: mediatek: mt7622: align error handling of mtk_hw_get_value call
Make consistent error handling of all mtk_hw_get_value occurrences using propagating error code from the internal instead of creating a new one. Signed-off-by: Sean Wang <sean.wang@mediatek.com> Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/pinctrl/mediatek/pinctrl-mt7622.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7622.c b/drivers/pinctrl/mediatek/pinctrl-mt7622.c
index dc32e3c3bd73..06e8406c4440 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mt7622.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mt7622.c
@@ -1160,7 +1160,7 @@ static int mtk_pinconf_get(struct pinctrl_dev *pctldev,
case PIN_CONFIG_OUTPUT_ENABLE:
err = mtk_hw_get_value(hw, pin, PINCTRL_PIN_REG_DIR, &val);
if (err)
- return -EINVAL;
+ return err;
/* HW takes input mode as zero; output mode as non-zero */
if ((val && param == PIN_CONFIG_INPUT_ENABLE) ||
@@ -1184,11 +1184,11 @@ static int mtk_pinconf_get(struct pinctrl_dev *pctldev,
case PIN_CONFIG_DRIVE_STRENGTH:
err = mtk_hw_get_value(hw, pin, PINCTRL_PIN_REG_E4, &val);
if (err)
- return -EINVAL;
+ return err;
err = mtk_hw_get_value(hw, pin, PINCTRL_PIN_REG_E8, &val2);
if (err)
- return -EINVAL;
+ return err;
/* 4mA when (e8, e4) = (0, 0); 8mA when (e8, e4) = (0, 1)
* 12mA when (e8, e4) = (1, 0); 16mA when (e8, e4) = (1, 1)
@@ -1203,7 +1203,7 @@ static int mtk_pinconf_get(struct pinctrl_dev *pctldev,
err = mtk_hw_get_value(hw, pin, reg, &val);
if (err)
- return -EINVAL;
+ return err;
ret = val;