Re: [PATCH v2 2/4] clk: hisilicon: Use helper functions

From: Stephen Boyd
Date: Wed Apr 05 2023 - 17:07:06 EST


Quoting David Yang (2023-03-29 00:50:51)
> Remove redundant codes.
>
> Signed-off-by: David Yang <mmyangfl@xxxxxxxxx>
> ---
> drivers/clk/hisilicon/clk-hi3519.c | 134 ++----------
> drivers/clk/hisilicon/clk-hi3559a.c | 228 +++-----------------
> drivers/clk/hisilicon/clk-hi3660.c | 207 ++++++------------
> drivers/clk/hisilicon/clk-hi3670.c | 270 +++++++++---------------
> drivers/clk/hisilicon/crg-hi3516cv300.c | 177 ++--------------
> drivers/clk/hisilicon/crg-hi3798cv200.c | 206 +++---------------

Maybe you can do this file by file in a different patch? And the commit
text can say that you're migrating to the new way of registering clks
with a device pointer?

> drivers/clk/hisilicon/crg.h | 6 -
> 7 files changed, 260 insertions(+), 968 deletions(-)
>
> diff --git a/drivers/clk/hisilicon/clk-hi3519.c b/drivers/clk/hisilicon/clk-hi3519.c
> index ad0c7f350cf0..199d1b8c3140 100644
> --- a/drivers/clk/hisilicon/clk-hi3519.c
> +++ b/drivers/clk/hisilicon/clk-hi3519.c
> @@ -6,11 +6,13 @@
> */
>
> #include <dt-bindings/clock/hi3519-clock.h>
> -#include <linux/clk-provider.h>

It's still a clk provider. Keep this include.

> +
> +#include <linux/kernel.h>
> #include <linux/module.h>
> -#include <linux/platform_device.h>

Also still a platform driver. Keep this include.

> +#include <linux/of_device.h>

Not sure what this include is for.

> +
> #include "clk.h"
> -#include "reset.h"
> +#include "crg.h"