Commit bf62efeb authored by Arnd Bergmann's avatar Arnd Bergmann Committed by 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: default avatarArnd Bergmann <arnd@arndb.de>
Fixes: e23efa31 ("gpio: pca954x: Add vcc regulator and enable it")
Acked-by: default avatarPhil Reid <preid@electromag.com.au>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 54c928d3
......@@ -853,6 +853,8 @@ static int pca953x_remove(struct i2c_client *client)
if (ret < 0)
dev_err(&client->dev, "%s failed, %d\n",
"teardown", ret);
} else {
ret = 0;
}
regulator_disable(chip->regulator);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment