From: Sean Anderson <seanga2@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH] clk: Add more information to debug messages
Date: Fri, 20 Mar 2020 01:53:16 -0400 [thread overview]
Message-ID: <20200320055316.746438-1-seanga2@gmail.com> (raw)
Some of the debug messages in the clock subsystem can be made more
informative by adding the clock name or adding the explicit error.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
---
drivers/clk/clk-uclass.c | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c
index 71878474eb..d44df05680 100644
--- a/drivers/clk/clk-uclass.c
+++ b/drivers/clk/clk-uclass.c
@@ -237,8 +237,8 @@ static int clk_set_default_parents(struct udevice *dev, int stage)
continue;
if (ret < 0) {
- debug("%s: failed to reparent clock %d for %s\n",
- __func__, index, dev_read_name(dev));
+ debug("%s: failed to reparent clock %d for %s (err = %d)\n",
+ __func__, index, dev_read_name(dev), ret);
return ret;
}
}
@@ -295,8 +295,8 @@ static int clk_set_default_rates(struct udevice *dev, int stage)
ret = clk_set_rate(&clk, rates[index]);
if (ret < 0) {
- debug("%s: failed to set rate on clock index %d (%ld) for %s\n",
- __func__, index, clk.id, dev_read_name(dev));
+ debug("%s: failed to set rate on clock index %d (%ld) for %s (err = %d)\n",
+ __func__, index, clk.id, dev_read_name(dev), ret);
break;
}
}
@@ -436,7 +436,7 @@ ulong clk_get_rate(struct clk *clk)
{
const struct clk_ops *ops;
- debug("%s(clk=%p)\n", __func__, clk);
+ debug("%s(clk=%p \"%s\")\n", __func__, clk, clk->dev->name);
if (!clk_valid(clk))
return 0;
ops = clk_dev_ops(clk->dev);
@@ -452,7 +452,7 @@ struct clk *clk_get_parent(struct clk *clk)
struct udevice *pdev;
struct clk *pclk;
- debug("%s(clk=%p)\n", __func__, clk);
+ debug("%s(clk=%p) \"%s\"\n", __func__, clk, clk->dev->name);
if (!clk_valid(clk))
return NULL;
@@ -469,7 +469,7 @@ long long clk_get_parent_rate(struct clk *clk)
const struct clk_ops *ops;
struct clk *pclk;
- debug("%s(clk=%p)\n", __func__, clk);
+ debug("%s(clk=%p \"%s\")\n", __func__, clk, clk->dev->name);
if (!clk_valid(clk))
return 0;
@@ -492,7 +492,8 @@ ulong clk_set_rate(struct clk *clk, ulong rate)
{
const struct clk_ops *ops;
- debug("%s(clk=%p, rate=%lu)\n", __func__, clk, rate);
+ debug("%s(clk=%p \"%s\", rate=%lu)\n", __func__, clk, clk->dev->name,
+ rate);
if (!clk_valid(clk))
return 0;
ops = clk_dev_ops(clk->dev);
@@ -507,7 +508,8 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
{
const struct clk_ops *ops;
- debug("%s(clk=%p, parent=%p)\n", __func__, clk, parent);
+ debug("%s(clk=%p \"%s\", parent=%p \"%s\")\n", __func__, clk,
+ clk->dev->name, parent, parent->dev->name);
if (!clk_valid(clk))
return 0;
ops = clk_dev_ops(clk->dev);
@@ -524,7 +526,7 @@ int clk_enable(struct clk *clk)
struct clk *clkp = NULL;
int ret;
- debug("%s(clk=%p)\n", __func__, clk);
+ debug("%s(clk=%p \"%s\")\n", __func__, clk, clk->dev->name);
if (!clk_valid(clk))
return 0;
ops = clk_dev_ops(clk->dev);
@@ -584,7 +586,7 @@ int clk_disable(struct clk *clk)
struct clk *clkp = NULL;
int ret;
- debug("%s(clk=%p)\n", __func__, clk);
+ debug("%s(clk=%p) \"%s\"\n", __func__, clk, clk->dev->name);
if (!clk_valid(clk))
return 0;
ops = clk_dev_ops(clk->dev);
--
2.25.1
next reply other threads:[~2020-03-20 5:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-20 5:53 Sean Anderson [this message]
2020-03-20 7:10 ` [PATCH] clk: Add more information to debug messages Lukasz Majewski
2020-06-30 9:55 ` Sean Anderson
2020-09-09 20:39 ` Sean Anderson
2020-09-10 13:38 ` Simon Glass
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=20200320055316.746438-1-seanga2@gmail.com \
--to=seanga2@gmail.com \
--cc=u-boot@lists.denx.de \
/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