Commit 41c9c06c authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Lee Jones

mfd: stmfx: 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>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent f104563f
......@@ -331,11 +331,9 @@ static int stmfx_chip_init(struct i2c_client *client)
ret = PTR_ERR_OR_ZERO(stmfx->vdd);
if (ret == -ENODEV) {
stmfx->vdd = NULL;
} else if (ret == -EPROBE_DEFER) {
return ret;
} else if (ret) {
dev_err(&client->dev, "Failed to get VDD regulator: %d\n", ret);
return ret;
} else {
return dev_err_probe(&client->dev, ret,
"Failed to get VDD regulator\n");
}
if (stmfx->vdd) {
......
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