提交 bf62efeb 编写于 作者: A Arnd Bergmann 提交者: Linus Walleij

gpio: pca954x: fix undefined error code from remove

The recent addition of the regulator support has led to the pca953x_remove
function returning uninitialized data when no platform data pointer is
provided, as gcc warns when using -Wmaybe-uninitialized:

drivers/gpio/gpio-pca953x.c: In function 'pca953x_remove':
drivers/gpio/gpio-pca953x.c:860:9: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]

This restores the previous behavior, returning 0 on success.
Signed-off-by: NArnd Bergmann <arnd@arndb.de>
Fixes: e23efa31 ("gpio: pca954x: Add vcc regulator and enable it")
Acked-by: NPhil Reid <preid@electromag.com.au>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 54c928d3
...@@ -853,6 +853,8 @@ static int pca953x_remove(struct i2c_client *client) ...@@ -853,6 +853,8 @@ static int pca953x_remove(struct i2c_client *client)
if (ret < 0) if (ret < 0)
dev_err(&client->dev, "%s failed, %d\n", dev_err(&client->dev, "%s failed, %d\n",
"teardown", ret); "teardown", ret);
} else {
ret = 0;
} }
regulator_disable(chip->regulator); regulator_disable(chip->regulator);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册