diff mbox series

[v1] host: Use dev_err_probe instead of dev_err

Message ID 20230726115439.5640-1-machel@vivo.com (mailing list archive)
State New, archived
Headers show
Series [v1] host: Use dev_err_probe instead of dev_err | expand

Commit Message

Wang Ming July 26, 2023, 11:54 a.m. UTC
It is possible that dma_request_chan will return EPROBE_DEFER,
which means that dev is not ready yet. In this case,
dev_err(dev), there will be no output. This patch fixes the bug.

Signed-off-by: Wang Ming <machel@vivo.com>
---
 drivers/mmc/host/pxamci.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index 2a988f942b6c..4068cdbed7e4 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -712,16 +712,16 @@  static int pxamci_probe(struct platform_device *pdev)
 
 	host->dma_chan_rx = dma_request_chan(dev, "rx");
 	if (IS_ERR(host->dma_chan_rx)) {
-		dev_err(dev, "unable to request rx dma channel\n");
-		ret = PTR_ERR(host->dma_chan_rx);
+		ret = dev_err_probe(dev, PTR_ERR(host->dma_chan_rx),
+			"unable to request rx dma channel\n");
 		host->dma_chan_rx = NULL;
 		goto out;
 	}
 
 	host->dma_chan_tx = dma_request_chan(dev, "tx");
 	if (IS_ERR(host->dma_chan_tx)) {
-		dev_err(dev, "unable to request tx dma channel\n");
-		ret = PTR_ERR(host->dma_chan_tx);
+		ret = dev_err_probe(dev, PTR_ERR(host->dma_chan_tx),
+			"unable to request tx dma channel\n");
 		host->dma_chan_tx = NULL;
 		goto out;
 	}