[PATCH v2 2/5] clk: mediatek: Refactor pll registration to pass device

Chen-Yu Tsai wenst at chromium.org
Thu Oct 9 00:19:27 PDT 2025


On Thu, Oct 9, 2025 at 12:06 AM Nicolas Frattaroli
<nicolas.frattaroli at collabora.com> wrote:
>
> As it stands, mtk_clk_register_plls takes a struct device_node pointer
> as its first argument. This is a tragic happenstance, as it's trivial to
> get the device_node from a struct device, but the opposite not so much.
> The struct device is a much more useful thing to have passed down.
>
> Refactor mtk_clk_register_plls to take a struct device pointer instead
> of a struct device_node pointer, and fix up all users of this function.
>
> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli at collabora.com>
> ---

Actually,

> diff --git a/drivers/clk/mediatek/clk-pll.h b/drivers/clk/mediatek/clk-pll.h
> index d71c150ce83e4bb2fe78290c2d5570a90084246d..0e2b94b9cd4b56adceee3b04e9ab24c2526471da 100644
> --- a/drivers/clk/mediatek/clk-pll.h
> +++ b/drivers/clk/mediatek/clk-pll.h
> @@ -78,9 +78,9 @@ struct mtk_clk_pll {
>         const struct mtk_pll_data *data;
>  };

Please replace the |struct device_node| forward declaration at the top
of this file with one for |struct device|.

> -int mtk_clk_register_plls(struct device_node *node,
> -                         const struct mtk_pll_data *plls, int num_plls,
> -                         struct clk_hw_onecell_data *clk_data);
> +int mtk_clk_register_plls(struct device *dev, const struct mtk_pll_data *plls,
> +                         int num_plls, struct clk_hw_onecell_data *clk_data);
> +
>  void mtk_clk_unregister_plls(const struct mtk_pll_data *plls, int num_plls,
>                              struct clk_hw_onecell_data *clk_data);
>
>
> --
> 2.51.0
>



More information about the Linux-mediatek mailing list