alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] slimbus: Use dev_err_probe instead of dev_err
@ 2023-07-19  5:11 王明-软件底层技术部
  0 siblings, 0 replies; only message in thread
From: 王明-软件底层技术部 @ 2023-07-19  5:11 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Srinivas Kandagatla,
	linux-arm-msm, alsa-devel, linux-kernel
  Cc: opensource.kernel,
	王明-软件底层技术部

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/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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-07-19  7:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-19  5:11 [PATCH v1] slimbus: Use dev_err_probe instead of dev_err 王明-软件底层技术部

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).