Skip to content

Commit 60576e8

Browse files
wdmegrvjic23
authored andcommitted
iio: adc: ti_am335x_adc: Fix return value check of tiadc_request_dma()
Fix wrong handling of a DMA request where the probing only failed if -EPROPE_DEFER was returned. Instead, let us fail if a non -ENODEV value is returned. This makes DMAs explicitly optional. Even if the DMA request is unsuccessfully, the ADC can still work properly. We do also handle the defer probe case by making use of dev_err_probe(). Fixes: f438b9d ("drivers: iio: ti_am335x_adc: add dma support") Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Reviewed-by: Bhavya Kapoor <b-kapoor@ti.com> Link: https://lore.kernel.org/r/20230925134427.214556-1-w.egorov@phytec.de Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent bce6147 commit 60576e8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/iio/adc/ti_am335x_adc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,8 +670,10 @@ static int tiadc_probe(struct platform_device *pdev)
670670
platform_set_drvdata(pdev, indio_dev);
671671

672672
err = tiadc_request_dma(pdev, adc_dev);
673-
if (err && err == -EPROBE_DEFER)
673+
if (err && err != -ENODEV) {
674+
dev_err_probe(&pdev->dev, err, "DMA request failed\n");
674675
goto err_dma;
676+
}
675677

676678
return 0;
677679

0 commit comments

Comments
 (0)