Commit 8b3d9cd4 authored by Sean Wang's avatar Sean Wang Committed by Linus Walleij

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: default avatarSean Wang <sean.wang@mediatek.com>
Reviewed-by: default avatarMatthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 181cdac0
...@@ -1160,7 +1160,7 @@ static int mtk_pinconf_get(struct pinctrl_dev *pctldev, ...@@ -1160,7 +1160,7 @@ static int mtk_pinconf_get(struct pinctrl_dev *pctldev,
case PIN_CONFIG_OUTPUT_ENABLE: case PIN_CONFIG_OUTPUT_ENABLE:
err = mtk_hw_get_value(hw, pin, PINCTRL_PIN_REG_DIR, &val); err = mtk_hw_get_value(hw, pin, PINCTRL_PIN_REG_DIR, &val);
if (err) if (err)
return -EINVAL; return err;
/* HW takes input mode as zero; output mode as non-zero */ /* HW takes input mode as zero; output mode as non-zero */
if ((val && param == PIN_CONFIG_INPUT_ENABLE) || if ((val && param == PIN_CONFIG_INPUT_ENABLE) ||
...@@ -1184,11 +1184,11 @@ static int mtk_pinconf_get(struct pinctrl_dev *pctldev, ...@@ -1184,11 +1184,11 @@ static int mtk_pinconf_get(struct pinctrl_dev *pctldev,
case PIN_CONFIG_DRIVE_STRENGTH: case PIN_CONFIG_DRIVE_STRENGTH:
err = mtk_hw_get_value(hw, pin, PINCTRL_PIN_REG_E4, &val); err = mtk_hw_get_value(hw, pin, PINCTRL_PIN_REG_E4, &val);
if (err) if (err)
return -EINVAL; return err;
err = mtk_hw_get_value(hw, pin, PINCTRL_PIN_REG_E8, &val2); err = mtk_hw_get_value(hw, pin, PINCTRL_PIN_REG_E8, &val2);
if (err) if (err)
return -EINVAL; return err;
/* 4mA when (e8, e4) = (0, 0); 8mA when (e8, e4) = (0, 1) /* 4mA when (e8, e4) = (0, 0); 8mA when (e8, e4) = (0, 1)
* 12mA when (e8, e4) = (1, 0); 16mA when (e8, e4) = (1, 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, ...@@ -1203,7 +1203,7 @@ static int mtk_pinconf_get(struct pinctrl_dev *pctldev,
err = mtk_hw_get_value(hw, pin, reg, &val); err = mtk_hw_get_value(hw, pin, reg, &val);
if (err) if (err)
return -EINVAL; return err;
ret = val; ret = val;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment