From: Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
Thierry Reding
<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Alexandre Courbot
<gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Subject: [PATCH 3/5] soc/tegra: Clean-up PMC rail IO error messages
Date: Sat, 22 Oct 2016 20:23:54 +0100 [thread overview]
Message-ID: <1477164236-29351-4-git-send-email-jonathanh@nvidia.com> (raw)
In-Reply-To: <1477164236-29351-1-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Clean-up the error messages in the PMC rail IO functions by:
1. Using pr_err instead of pr_info which is currently used.
2. Use the compiler __func__ marco for displaying the function name.
3. Add specific error messages to the function tegra_io_rail_prepare()
instead of just reporting it failed.
Signed-off-by: Jon Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
drivers/soc/tegra/pmc.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index 6a6df6e8bfd6..8c9797379949 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -919,8 +919,10 @@ static int tegra_io_rail_prepare(unsigned int id, unsigned long *request,
* There are two sets of 30 bits to select IO rails, but bits 30 and
* 31 are control bits rather than IO rail selection bits.
*/
- if (id > 63 || *bit & IO_DPD_REQ_CODE_MASK)
+ if (id > 63 || *bit & IO_DPD_REQ_CODE_MASK) {
+ pr_err("%s(): invalid rail ID %d\n", __func__, id);
return -EINVAL;
+ }
if (id < 32) {
*status = IO_DPD_STATUS;
@@ -931,8 +933,10 @@ static int tegra_io_rail_prepare(unsigned int id, unsigned long *request,
}
rate = clk_get_rate(pmc->clk);
- if (!rate)
+ if (!rate) {
+ pr_err("%s(): failed to get clock rate\n", __func__);
return -ENODEV;
+ }
tegra_pmc_writel(DPD_SAMPLE_ENABLE, DPD_SAMPLE);
@@ -983,7 +987,7 @@ int tegra_io_rail_power_on(unsigned int id)
err = tegra_io_rail_poll(status, bit, 0, 250);
if (err) {
- pr_info("tegra_io_rail_poll() failed: %d\n", err);
+ pr_err("%s(): failed to power on rail %d\n", __func__, id);
goto error;
}
@@ -1005,16 +1009,16 @@ int tegra_io_rail_power_off(unsigned int id)
mutex_lock(&pmc->powergates_lock);
err = tegra_io_rail_prepare(id, &request, &status, &bit);
- if (err) {
- pr_info("tegra_io_rail_prepare() failed: %d\n", err);
+ if (err)
goto error;
- }
tegra_pmc_writel(IO_DPD_REQ_CODE_ON | bit, request);
err = tegra_io_rail_poll(status, bit, bit, 250);
- if (err)
+ if (err) {
+ pr_err("%s(): failed to power off rail %d\n", __func__, id);
goto error;
+ }
tegra_io_rail_unprepare();
--
1.9.1
next prev parent reply other threads:[~2016-10-22 19:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-22 19:23 [PATCH 0/5] Tegra PMC Updates Jon Hunter
[not found] ` <1477164236-29351-1-git-send-email-jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-10-22 19:23 ` [PATCH 1/5] soc/tegra: pmc: Guard against uninitialised PMC clock Jon Hunter
2016-10-22 19:23 ` [PATCH 2/5] soc/tegra: pmc: Simplify IO rail bit handling Jon Hunter
2016-10-22 19:23 ` Jon Hunter [this message]
2016-10-22 19:23 ` [PATCH 4/5] soc/tegra: pmc: Check return code for pm_genpd_init() Jon Hunter
2016-10-22 19:23 ` [PATCH 5/5] soc/tegra: pmc: Remove genpd when adding provider fails Jon Hunter
2016-11-08 11:09 ` [PATCH 0/5] Tegra PMC Updates Thierry Reding
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=1477164236-29351-4-git-send-email-jonathanh@nvidia.com \
--to=jonathanh-ddmlm1+adcrqt0dzr+alfa@public.gmane.org \
--cc=gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
--cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/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;
as well as URLs for NNTP newsgroup(s).