public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 0/2] clk: clk-uclass: debug message improvements
@ 2026-01-08 18:05 David Lechner
  2026-01-08 18:05 ` [PATCH 1/2] clk: clk-uclass: fix format specifier for ofnode name David Lechner
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David Lechner @ 2026-01-08 18:05 UTC (permalink / raw)
  To: Lukasz Majewski, Tom Rini; +Cc: Julien Stephan, u-boot, David Lechner

I needed to debug some clock issues and found some places where pointer
addresses were being printed when names were available. The addresses
are not very helpful, but the names are. So here a couple of patches to
improve that.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
David Lechner (2):
      clk: clk-uclass: fix format specifier for ofnode name
      clk: clk-uclass: used dev name in debug message

 drivers/clk/clk-uclass.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
---
base-commit: 141be72e2a9d43aa4e3d1a6a6e0ab8f9eb8784c6
change-id: 20260108-clk-uclass-better-debug-1efeb0dcf54e

Best regards,
-- 
David Lechner <dlechner@baylibre.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] clk: clk-uclass: fix format specifier for ofnode name
  2026-01-08 18:05 [PATCH 0/2] clk: clk-uclass: debug message improvements David Lechner
@ 2026-01-08 18:05 ` David Lechner
  2026-01-08 18:05 ` [PATCH 2/2] clk: clk-uclass: used dev name in debug message David Lechner
  2026-01-21 20:48 ` [PATCH 0/2] clk: clk-uclass: debug message improvements Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: David Lechner @ 2026-01-08 18:05 UTC (permalink / raw)
  To: Lukasz Majewski, Tom Rini; +Cc: Julien Stephan, u-boot, David Lechner

Change the format specifier from %p to %s when printing the ofnode name
so that the actual name is printed instead of the pointer address.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/clk/clk-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c
index 0584429bed6..0e56d207b0e 100644
--- a/drivers/clk/clk-uclass.c
+++ b/drivers/clk/clk-uclass.c
@@ -410,7 +410,7 @@ int clk_get_by_name_nodev(ofnode node, const char *name, struct clk *clk)
 {
 	int index = 0;
 
-	debug("%s(node=%p, name=%s, clk=%p)\n", __func__,
+	debug("%s(node=%s, name=%s, clk=%p)\n", __func__,
 		ofnode_get_name(node), name, clk);
 	clk->dev = NULL;
 

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] clk: clk-uclass: used dev name in debug message
  2026-01-08 18:05 [PATCH 0/2] clk: clk-uclass: debug message improvements David Lechner
  2026-01-08 18:05 ` [PATCH 1/2] clk: clk-uclass: fix format specifier for ofnode name David Lechner
@ 2026-01-08 18:05 ` David Lechner
  2026-01-21 20:48 ` [PATCH 0/2] clk: clk-uclass: debug message improvements Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: David Lechner @ 2026-01-08 18:05 UTC (permalink / raw)
  To: Lukasz Majewski, Tom Rini; +Cc: Julien Stephan, u-boot, David Lechner

Consistently use the device name in debug messages. The clk-uclass file
previously had a mix of printing the dev pointer and the device name.
Changing all to use the device name makes the debug messages more
useful.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/clk/clk-uclass.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c
index 0e56d207b0e..c33f415917e 100644
--- a/drivers/clk/clk-uclass.c
+++ b/drivers/clk/clk-uclass.c
@@ -122,7 +122,8 @@ static int clk_get_by_indexed_prop(struct udevice *dev, const char *prop_name,
 	int ret;
 	struct ofnode_phandle_args args;
 
-	debug("%s(dev=%p, index=%d, clk=%p)\n", __func__, dev, index, clk);
+	debug("%s(dev=%s, index=%d, clk=%p)\n", __func__, dev_read_name(dev),
+	      index, clk);
 
 	assert(clk);
 	clk->dev = NULL;
@@ -183,8 +184,8 @@ int clk_get_bulk(struct udevice *dev, struct clk_bulk *bulk)
 bulk_get_err:
 	err = clk_release_all(bulk->clks, bulk->count);
 	if (err)
-		debug("%s: could not release all clocks for %p\n",
-		      __func__, dev);
+		debug("%s: could not release all clocks for %s\n",
+		      __func__, dev_read_name(dev));
 
 	return ret;
 }
@@ -217,8 +218,8 @@ static int clk_set_default_parents(struct udevice *dev,
 	num_parents = dev_count_phandle_with_args(dev, "assigned-clock-parents",
 						  "#clock-cells", 0);
 	if (num_parents < 0) {
-		debug("%s: could not read assigned-clock-parents for %p\n",
-		      __func__, dev);
+		debug("%s: could not read assigned-clock-parents for %s\n",
+		      __func__, dev_read_name(dev));
 		return 0;
 	}
 
@@ -467,7 +468,7 @@ int clk_request(struct udevice *dev, struct clk *clk)
 {
 	const struct clk_ops *ops;
 
-	debug("%s(dev=%p, clk=%p)\n", __func__, dev, clk);
+	debug("%s(dev=%s, clk=%p)\n", __func__, dev_read_name(dev), clk);
 	if (!clk)
 		return 0;
 	ops = clk_dev_ops(dev);

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] clk: clk-uclass: debug message improvements
  2026-01-08 18:05 [PATCH 0/2] clk: clk-uclass: debug message improvements David Lechner
  2026-01-08 18:05 ` [PATCH 1/2] clk: clk-uclass: fix format specifier for ofnode name David Lechner
  2026-01-08 18:05 ` [PATCH 2/2] clk: clk-uclass: used dev name in debug message David Lechner
@ 2026-01-21 20:48 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2026-01-21 20:48 UTC (permalink / raw)
  To: Lukasz Majewski, David Lechner; +Cc: Julien Stephan, u-boot

On Thu, 08 Jan 2026 12:05:53 -0600, David Lechner wrote:

> I needed to debug some clock issues and found some places where pointer
> addresses were being printed when names were available. The addresses
> are not very helpful, but the names are. So here a couple of patches to
> improve that.
> 
> 

Applied to u-boot/master, thanks!

[1/2] clk: clk-uclass: fix format specifier for ofnode name
      commit: ec956adf378a4b3bf133a2c1b6614c4891743843
[2/2] clk: clk-uclass: used dev name in debug message
      commit: 2540dd7be91608af2df7138e9fd60aa9778b7290
-- 
Tom



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-01-21 20:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-08 18:05 [PATCH 0/2] clk: clk-uclass: debug message improvements David Lechner
2026-01-08 18:05 ` [PATCH 1/2] clk: clk-uclass: fix format specifier for ofnode name David Lechner
2026-01-08 18:05 ` [PATCH 2/2] clk: clk-uclass: used dev name in debug message David Lechner
2026-01-21 20:48 ` [PATCH 0/2] clk: clk-uclass: debug message improvements Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox