mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 15:37:23 +00:00
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>
This commit is contained in:
parent
c65b7d1acf
commit
97bf73762f
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue