summaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc/stm32-dfsdm-adc.c
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzk@kernel.org>2020-08-29 08:47:16 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-09-03 20:40:50 +0200
commitce30eeb613cbde817ae3c041505a3181cccb9d35 (patch)
treec6b18f66e6330c7c9676e51aa391ac386914cc33 /drivers/iio/adc/stm32-dfsdm-adc.c
parentiio: adc: rcar-gyroadc: Simplify with dev_err_probe() (diff)
downloadlinux-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/adc/stm32-dfsdm-adc.c')
-rw-r--r--drivers/iio/adc/stm32-dfsdm-adc.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c
index 5e10fb4f3704..c7e0109315f8 100644
--- a/drivers/iio/adc/stm32-dfsdm-adc.c
+++ b/drivers/iio/adc/stm32-dfsdm-adc.c
@@ -1473,13 +1473,9 @@ static int stm32_dfsdm_adc_init(struct device *dev, struct iio_dev *indio_dev)
/* Optionally request DMA */
ret = stm32_dfsdm_dma_request(dev, indio_dev);
if (ret) {
- if (ret != -ENODEV) {
- if (ret != -EPROBE_DEFER)
- dev_err(dev,
- "DMA channel request failed with %d\n",
- ret);
- return ret;
- }
+ if (ret != -ENODEV)
+ return dev_err_probe(dev, ret,
+ "DMA channel request failed with\n");
dev_dbg(dev, "No DMA support\n");
return 0;