Skip to content

Commit

Permalink
pinctrl: mediatek: add a check for error in mtk_pinconf_bias_get_rsel()
Browse files Browse the repository at this point in the history
All the other mtk_hw_get_value() calls have a check for "if (err)" so
we can add one here as well.  This silences a Smatch warning:

    drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c:819 mtk_pinconf_bias_get_rsel()
    error: uninitialized symbol 'pd'.

Fixes: fb34a9a ("pinctrl: mediatek: support rsel feature")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20211127140836.GB24002@kili
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Dan Carpenter authored and Linus Walleij committed Dec 2, 2021
1 parent 67bbbcb commit 9f9d17c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,8 @@ static int mtk_pinconf_bias_get_rsel(struct mtk_pinctrl *hw,
goto out;

err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PD, &pd);
if (err)
goto out;

if (pu == 0 && pd == 0) {
*pullup = 0;
Expand Down

0 comments on commit 9f9d17c

Please sign in to comment.