From 258c1002383e5f0ca1d00cc2e4deae3cb488a26d Mon Sep 17 00:00:00 2001 From: Igor Prusov Date: Thu, 9 Nov 2023 13:55:14 +0300 Subject: cmd: clk: Use dump function from clk_ops Add another loop to dump additional info from clock providers that implement dump operation. Reviewed-by: Patrice Chotard Tested-by: Patrice Chotard Reviewed-by: Sean Anderson Signed-off-by: Igor Prusov Link: https://lore.kernel.org/r/20231109105516.24892-7-ivprusov@sberdevices.ru --- cmd/clk.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cmd') diff --git a/cmd/clk.c b/cmd/clk.c index c7c379d7a61..4b9709d3ff9 100644 --- a/cmd/clk.c +++ b/cmd/clk.c @@ -62,6 +62,7 @@ static void show_clks(struct udevice *dev, int depth, int last_flag) int __weak soc_clk_dump(void) { struct udevice *dev; + const struct clk_ops *ops; printf(" Rate Usecnt Name\n"); printf("------------------------------------------\n"); @@ -69,6 +70,14 @@ int __weak soc_clk_dump(void) uclass_foreach_dev_probe(UCLASS_CLK, dev) show_clks(dev, -1, 0); + uclass_foreach_dev_probe(UCLASS_CLK, dev) { + ops = dev_get_driver_ops(dev); + if (ops && ops->dump) { + printf("\n%s %s:\n", dev->driver->name, dev->name); + ops->dump(dev); + } + } + return 0; } #else -- cgit v1.3.1 From 5666558a6cb04b2f731a7a13d0bbaefa528e7616 Mon Sep 17 00:00:00 2001 From: Igor Prusov Date: Thu, 9 Nov 2023 13:55:16 +0300 Subject: cmd: clk: Make soc_clk_dump static After introducing dump to clk_ops there is no need to override or expose this symbol anymore. Reviewed-by: Patrice Chotard Tested-by: Patrice Chotard Reviewed-by: Sean Anderson Signed-off-by: Igor Prusov Link: https://lore.kernel.org/r/20231109105516.24892-9-ivprusov@sberdevices.ru --- cmd/clk.c | 4 ++-- include/clk.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'cmd') diff --git a/cmd/clk.c b/cmd/clk.c index 4b9709d3ff9..7bbcbfeda33 100644 --- a/cmd/clk.c +++ b/cmd/clk.c @@ -59,7 +59,7 @@ static void show_clks(struct udevice *dev, int depth, int last_flag) } } -int __weak soc_clk_dump(void) +static int soc_clk_dump(void) { struct udevice *dev; const struct clk_ops *ops; @@ -81,7 +81,7 @@ int __weak soc_clk_dump(void) return 0; } #else -int __weak soc_clk_dump(void) +static int soc_clk_dump(void) { puts("Not implemented\n"); return 1; diff --git a/include/clk.h b/include/clk.h index 249c0e0ab42..3d6394477be 100644 --- a/include/clk.h +++ b/include/clk.h @@ -676,8 +676,6 @@ static inline bool clk_valid(struct clk *clk) return clk && !!clk->dev; } -int soc_clk_dump(void); - #endif #define clk_prepare_enable(clk) clk_enable(clk) -- cgit v1.3.1