Commit ca6a77eb authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Bartosz Golaszewski

gpio: pca953x: Simplify with dev_err_probe()

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.
Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
parent 4e7ed696
...@@ -1000,12 +1000,9 @@ static int pca953x_probe(struct i2c_client *client, ...@@ -1000,12 +1000,9 @@ static int pca953x_probe(struct i2c_client *client,
chip->client = client; chip->client = client;
reg = devm_regulator_get(&client->dev, "vcc"); reg = devm_regulator_get(&client->dev, "vcc");
if (IS_ERR(reg)) { if (IS_ERR(reg))
ret = PTR_ERR(reg); return dev_err_probe(&client->dev, PTR_ERR(reg), "reg get err\n");
if (ret != -EPROBE_DEFER)
dev_err(&client->dev, "reg get err: %d\n", ret);
return ret;
}
ret = regulator_enable(reg); ret = regulator_enable(reg);
if (ret) { if (ret) {
dev_err(&client->dev, "reg en err: %d\n", ret); dev_err(&client->dev, "reg en err: %d\n", ret);
......
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