[PATCH v2] slimbus: 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 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/slimbus/qcom-ngd-ctrl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
index 77aa6d26476c..d5c2a732f63f 100644
--- a/drivers/slimbus/qcom-ngd-ctrl.c
+++ b/drivers/slimbus/qcom-ngd-ctrl.c
@@ -679,8 +679,8 @@ static int qcom_slim_ngd_init_rx_msgq(struct qcom_slim_ngd_ctrl *ctrl)
 
 	ctrl->dma_rx_channel = dma_request_chan(dev, "rx");
 	if (IS_ERR(ctrl->dma_rx_channel)) {
-		dev_err(dev, "Failed to request RX dma channel");
-		ret = PTR_ERR(ctrl->dma_rx_channel);
+		ret = dev_err_probe(dev, PTR_ERR(ctrl->dma_rx_channel),
+			"Failed to request RX dma channel");
 		ctrl->dma_rx_channel = NULL;
 		return ret;
 	}
@@ -717,8 +717,8 @@ static int qcom_slim_ngd_init_tx_msgq(struct qcom_slim_ngd_ctrl *ctrl)
 
 	ctrl->dma_tx_channel = dma_request_chan(dev, "tx");
 	if (IS_ERR(ctrl->dma_tx_channel)) {
-		dev_err(dev, "Failed to request TX dma channel");
-		ret = PTR_ERR(ctrl->dma_tx_channel);
+		ret = dev_err_probe(dev, PTR_ERR(ctrl->dma_tx_channel),
+			"Failed to request TX dma channel");
 		ctrl->dma_tx_channel = NULL;
 		return ret;
 	}
-- 
2.25.1




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux