mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-20 20:04:46 +00:00
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 <patrice.chotard@foss.st.com> Tested-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Sean Anderson <seanga2@gmail.com> Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru> Link: https://lore.kernel.org/r/20231109105516.24892-7-ivprusov@sberdevices.ru
This commit is contained in:
parent
505ef5f627
commit
258c100238
1 changed files with 9 additions and 0 deletions
|
@ -62,6 +62,7 @@ static void show_clks(struct udevice *dev, int depth, int last_flag)
|
||||||
int __weak soc_clk_dump(void)
|
int __weak soc_clk_dump(void)
|
||||||
{
|
{
|
||||||
struct udevice *dev;
|
struct udevice *dev;
|
||||||
|
const struct clk_ops *ops;
|
||||||
|
|
||||||
printf(" Rate Usecnt Name\n");
|
printf(" Rate Usecnt Name\n");
|
||||||
printf("------------------------------------------\n");
|
printf("------------------------------------------\n");
|
||||||
|
@ -69,6 +70,14 @@ int __weak soc_clk_dump(void)
|
||||||
uclass_foreach_dev_probe(UCLASS_CLK, dev)
|
uclass_foreach_dev_probe(UCLASS_CLK, dev)
|
||||||
show_clks(dev, -1, 0);
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Reference in a new issue