[PATCH v2] mmc: host: Use dev_err_probe instead of dev_err

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


It is possible that dma_request_chan will return EPROBE_DEFER,
which means that host->dev is not ready yet. In this case,
dev_err(host->dev), there will be no output. This patch fixes the bug.

Signed-off-by: Wang Ming <machel@xxxxxxxx>
 drivers/mmc/host/dw_mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 829af2c98a44..5a3eefd86931 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -841,9 +841,9 @@ static int dw_mci_edmac_init(struct dw_mci *host)
 	host->dms->ch = dma_request_chan(host->dev, "rx-tx");
 	if (IS_ERR(host->dms->ch)) {
-		int ret = PTR_ERR(host->dms->ch);
+		int ret = dev_err_probe(host->dev, PTR_ERR(host->dms->ch),
+			"Failed to get external DMA channel.\n");
-		dev_err(host->dev, "Failed to get external DMA channel.\n");
 		host->dms = NULL;
 		return ret;

[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux