[PATCH v1] host: Use dev_err_probe instead of dev_err

From: Wang Ming
Date: Wed Jul 26 2023 - 07:55:05 EST


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@xxxxxxxx>
---
drivers/mmc/host/pxamci.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

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;
}
--
2.25.1