diff options
author | Krzysztof Kozlowski <krzk@kernel.org> | 2020-08-26 16:49:34 +0200 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2020-09-30 17:24:59 +0200 |
commit | 41c9c06c491a92e186e41ff64163fa74f08e15e6 (patch) | |
tree | 722c6102e7a1b48d1ae1e18e55d15b1e82b44c10 /drivers/mfd/stmfx.c | |
parent | mfd: madera: Simplify with dev_err_probe() (diff) | |
download | linux-41c9c06c491a92e186e41ff64163fa74f08e15e6.tar.xz linux-41c9c06c491a92e186e41ff64163fa74f08e15e6.zip |
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: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/stmfx.c')
-rw-r--r-- | drivers/mfd/stmfx.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/mfd/stmfx.c b/drivers/mfd/stmfx.c index 711979afd90a..5e680bfdf5c9 100644 --- a/drivers/mfd/stmfx.c +++ b/drivers/mfd/stmfx.c @@ -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) { |