From: Lukasz Majewski <lukma@denx.de>
To: u-boot@lists.denx.de
Subject: [PATCH] clk: Add more information to debug messages
Date: Fri, 20 Mar 2020 08:10:12 +0100 [thread overview]
Message-ID: <20200320081012.2156aab6@jawa> (raw)
In-Reply-To: <20200320055316.746438-1-seanga2@gmail.com>
On Fri, 20 Mar 2020 01:53:16 -0400
Sean Anderson <seanga2@gmail.com> wrote:
> 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);
Acked-by: Lukasz Majewski <lukma@denx.de>
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200320/2d932705/attachment.sig>
next prev parent reply other threads:[~2020-03-20 7:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-20 5:53 [PATCH] clk: Add more information to debug messages Sean Anderson
2020-03-20 7:10 ` Lukasz Majewski [this message]
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=20200320081012.2156aab6@jawa \
--to=lukma@denx.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.