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 <[email protected]> Reviewed-by: Bhavya Kapoor <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent bce6147 commit 60576e8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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)