diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2020-12-27 21:18:26 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-01-18 15:23:06 -0500 |
commit | 97bf73762fed743291bb7e572aa659374990b93d (patch) | |
tree | 718194067045c1846a16935172b7f818e76a87cd | |
parent | c65b7d1acfffda1a73bcea2cd0d2bc43ce54540f (diff) | |
download | u-boot-97bf73762fed743291bb7e572aa659374990b93d.tar.gz |
pinctrl: mediatek: correct error handling
If no GPIO controller is found, the return value should not depend on a
random value on the stack. Initialize variable ret.
The problem was indicated by cppcheck.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
-rw-r--r-- | drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c index 6553dde45c..4dd3f73ead 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c @@ -615,6 +615,7 @@ static int mtk_gpiochip_register(struct udevice *parent) if (!drv) return -ENOENT; + ret = -ENOENT; dev_for_each_subnode(node, parent) if (ofnode_read_bool(node, "gpio-controller")) { ret = 0; |