From: Nicolin Chen <nicoleotsuka@gmail.com>
To: vinod.koul@intel.com, jonathanh@nvidia.com
Cc: linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org,
dmaengine@vger.kernel.org, gnurou@gmail.com,
thierry.reding@gmail.com, swarren@wwwdotorg.org,
ldewangan@nvidia.com
Subject: [PATCH] dmaengine: tegra210-adma: Add some necessary dev_err() before error out
Date: Thu, 1 Sep 2016 15:43:17 -0700 [thread overview]
Message-ID: <1472769797-31650-2-git-send-email-nicoleotsuka@gmail.com> (raw)
In-Reply-To: <1472769797-31650-1-git-send-email-nicoleotsuka@gmail.com>
There could be something going wrong during the probe() part,
so it would not be ideal for debugging by silently returning.
This patches adds some necessary dev_err() to give the hints.
Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
---
drivers/dma/tegra210-adma.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c
index b10cbaa..09b46f7 100644
--- a/drivers/dma/tegra210-adma.c
+++ b/drivers/dma/tegra210-adma.c
@@ -218,8 +218,10 @@ static int tegra_adma_init(struct tegra_adma *tdma)
ret = readx_poll_timeout(readl,
tdma->base_addr + ADMA_GLOBAL_SOFT_RESET,
status, status == 0, 20, 10000);
- if (ret)
+ if (ret) {
+ dev_err(tdma->dev, "Timeout waiting for soft reset\n");
return ret;
+ }
/* Enable global ADMA registers */
tdma_write(tdma, ADMA_GLOBAL_CMD, 1);
@@ -581,6 +583,7 @@ static int tegra_adma_alloc_chan_resources(struct dma_chan *dc)
ret = pm_runtime_get_sync(tdc2dev(tdc));
if (ret < 0) {
+ dev_err(tdc2dev(tdc), "failed to get pm runtime: %d\n", ret);
free_irq(tdc->irq, tdc);
return ret;
}
@@ -647,8 +650,10 @@ static int tegra_adma_runtime_resume(struct device *dev)
int ret;
ret = pm_clk_resume(dev);
- if (ret)
+ if (ret) {
+ dev_err(dev, "failed to resume pm clock: %d\n", ret);
return ret;
+ }
tdma_write(tdma, ADMA_GLOBAL_CMD, tdma->global_cmd);
@@ -718,6 +723,9 @@ static int tegra_adma_probe(struct platform_device *pdev)
tdc->irq = of_irq_get(pdev->dev.of_node, i);
if (tdc->irq < 0) {
+ dev_err(&pdev->dev,
+ "failed to get irq for channel %d: %d\n",
+ i + 1, tdc->irq);
ret = tdc->irq;
goto irq_dispose;
}
--
2.1.4
next prev parent reply other threads:[~2016-09-01 22:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-01 22:43 [PATCH] dmaengine: tegra210-adma: Add memcpy support Nicolin Chen
2016-09-01 22:43 ` Nicolin Chen [this message]
2016-09-02 11:25 ` Vinod Koul
2016-09-02 18:34 ` Nicolin Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1472769797-31650-2-git-send-email-nicoleotsuka@gmail.com \
--to=nicoleotsuka@gmail.com \
--cc=dmaengine@vger.kernel.org \
--cc=gnurou@gmail.com \
--cc=jonathanh@nvidia.com \
--cc=ldewangan@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=swarren@wwwdotorg.org \
--cc=thierry.reding@gmail.com \
--cc=vinod.koul@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®