mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-22 23:12:32 +00:00
3cb2fddd30
Backport new features for MediaTek pinctrl/pinconf drivers from upstream. This will serve as the base to improve pinconf bias/pull-up/pull-down on MT7981 and MT7986, and also prepare for upcoming support for MT7988. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
32 lines
1.1 KiB
Diff
32 lines
1.1 KiB
Diff
From 9f9d17c228c89e38ed612500126daf626270be9a Mon Sep 17 00:00:00 2001
|
|
From: Dan Carpenter <dan.carpenter@oracle.com>
|
|
Date: Sat, 27 Nov 2021 17:08:36 +0300
|
|
Subject: [PATCH] pinctrl: mediatek: add a check for error in
|
|
mtk_pinconf_bias_get_rsel()
|
|
|
|
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: fb34a9ae383a ("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>
|
|
---
|
|
drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 2 ++
|
|
1 file changed, 2 insertions(+)
|
|
|
|
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
|
|
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
|
|
@@ -815,6 +815,8 @@ static int mtk_pinconf_bias_get_rsel(str
|
|
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;
|