diff options
author | Krzysztof Kozlowski <krzk@kernel.org> | 2020-08-29 08:47:16 +0200 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2020-09-03 20:40:50 +0200 |
commit | ce30eeb613cbde817ae3c041505a3181cccb9d35 (patch) | |
tree | c6b18f66e6330c7c9676e51aa391ac386914cc33 /drivers/iio/dac | |
parent | iio: adc: rcar-gyroadc: Simplify with dev_err_probe() (diff) | |
download | linux-ce30eeb613cbde817ae3c041505a3181cccb9d35.tar.xz linux-ce30eeb613cbde817ae3c041505a3181cccb9d35.zip |
iio: adc: stm32: 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>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200829064726.26268-8-krzk@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/dac')
-rw-r--r-- | drivers/iio/dac/stm32-dac-core.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/iio/dac/stm32-dac-core.c b/drivers/iio/dac/stm32-dac-core.c index 7e5809ba0dee..906436780347 100644 --- a/drivers/iio/dac/stm32-dac-core.c +++ b/drivers/iio/dac/stm32-dac-core.c @@ -150,10 +150,7 @@ static int stm32_dac_probe(struct platform_device *pdev) rst = devm_reset_control_get_optional_exclusive(dev, NULL); if (rst) { if (IS_ERR(rst)) { - ret = PTR_ERR(rst); - if (ret != -EPROBE_DEFER) - dev_err(dev, "reset get failed, %d\n", ret); - + ret = dev_err_probe(dev, PTR_ERR(rst), "reset get failed\n"); goto err_hw_stop; } |