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
@ -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 New Issue
Block a user