[PATCH v4 4/8] clk: amlogic: Move driver and ops structs
Neil Armstrong
neil.armstrong at linaro.org
Wed Oct 18 09:42:37 CEST 2023
On 17/10/2023 18:56, Igor Prusov wrote:
> Move driver and ops structs to avoid forward declaration after switching
> to dump in clk_ops.
>
> Signed-off-by: Igor Prusov <ivprusov at sberdevices.ru>
> ---
> drivers/clk/meson/a1.c | 34 +++++++++++++++++-----------------
> 1 file changed, 17 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/clk/meson/a1.c b/drivers/clk/meson/a1.c
> index 1075ba7333..e3fa9db7d0 100644
> --- a/drivers/clk/meson/a1.c
> +++ b/drivers/clk/meson/a1.c
> @@ -601,14 +601,6 @@ static int meson_clk_set_parent(struct clk *clk, struct clk *parent_clk)
> return meson_mux_set_parent_by_id(clk, parent_clk->id);
> }
>
> -static struct clk_ops meson_clk_ops = {
> - .disable = meson_clk_disable,
> - .enable = meson_clk_enable,
> - .get_rate = meson_clk_get_rate,
> - .set_rate = meson_clk_set_rate,
> - .set_parent = meson_clk_set_parent,
> -};
> -
> static int meson_clk_probe(struct udevice *dev)
> {
> struct meson_clk *priv = dev_get_priv(dev);
> @@ -638,15 +630,6 @@ static const struct udevice_id meson_clk_ids[] = {
> { }
> };
>
> -U_BOOT_DRIVER(meson_clk) = {
> - .name = "meson-clk-a1",
> - .id = UCLASS_CLK,
> - .of_match = meson_clk_ids,
> - .priv_auto = sizeof(struct meson_clk),
> - .ops = &meson_clk_ops,
> - .probe = meson_clk_probe,
> -};
> -
> static const char *meson_clk_get_name(struct clk *clk, int id)
> {
> const struct meson_clk_info *info;
> @@ -727,3 +710,20 @@ int soc_clk_dump(void)
>
> return 0;
> }
> +
> +static struct clk_ops meson_clk_ops = {
> + .disable = meson_clk_disable,
> + .enable = meson_clk_enable,
> + .get_rate = meson_clk_get_rate,
> + .set_rate = meson_clk_set_rate,
> + .set_parent = meson_clk_set_parent,
> +};
> +
> +U_BOOT_DRIVER(meson_clk) = {
> + .name = "meson-clk-a1",
> + .id = UCLASS_CLK,
> + .of_match = meson_clk_ids,
> + .priv_auto = sizeof(struct meson_clk),
> + .ops = &meson_clk_ops,
> + .probe = meson_clk_probe,
> +};
Reviewed-by: Neil Armstrong <neil.armstrong at linaro.org>
More information about the U-Boot
mailing list