[PATCH v3 5/7] cmd: clk: Use dump function from clk_ops

Patrice CHOTARD patrice.chotard at foss.st.com
Mon Aug 28 11:56:48 CEST 2023



On 7/14/23 17:24, Igor Prusov wrote:
> Add another loop to dump additional info from clock providers that
> implement dump operation.
> 
> Signed-off-by: Igor Prusov <ivprusov at sberdevices.ru>
> ---
>  cmd/clk.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/cmd/clk.c b/cmd/clk.c
> index ff7c7649a1..55fb96e631 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");
> +			ops->dump(dev);
> +		}
> +	}
> +
>  	return 0;
>  }
>  #else

Reviewed-by: Patrice Chotard <patrice.chotard at foss.st.com>
Tested-by: Patrice Chotard <patrice.chotard at foss.st.com>

Thanks
Patrice


More information about the U-Boot mailing list