public inbox for linux-mediatek@lists.infradead.org
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: "Nicolas Frattaroli" <nicolas.frattaroli@collabora.com>,
	"Michael Turquette" <mturquette@baylibre.com>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"Dong Aisheng" <aisheng.dong@nxp.com>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Yassine Oudjana" <y.oudjana@protonmail.com>,
	"Laura Nao" <laura.nao@collabora.com>,
	"Nícolas F. R. A. Prado" <nfraprado@collabora.com>,
	"Chia-I Wu" <olvaffe@gmail.com>,
	"Chen-Yu Tsai" <wenst@chromium.org>
Cc: kernel@collabora.com, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org,
	Stephen Boyd <sboyd@codeaurora.org>
Subject: Re: [PATCH v2 2/5] clk: mediatek: Refactor pll registration to pass device
Date: Thu, 9 Oct 2025 10:09:35 +0200	[thread overview]
Message-ID: <2477df4e-c89e-408f-bb2a-d5af51f78ef8@collabora.com> (raw)
In-Reply-To: <20251008-mtk-pll-rpm-v2-2-170ed0698560@collabora.com>

Il 08/10/25 18:05, Nicolas Frattaroli ha scritto:
> 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@collabora.com>
> ---
>   drivers/clk/mediatek/clk-mt2701.c            | 2 +-
>   drivers/clk/mediatek/clk-mt2712-apmixedsys.c | 2 +-
>   drivers/clk/mediatek/clk-mt6735-apmixedsys.c | 4 ++--
>   drivers/clk/mediatek/clk-mt6765.c            | 2 +-
>   drivers/clk/mediatek/clk-mt6779.c            | 2 +-
>   drivers/clk/mediatek/clk-mt6797.c            | 2 +-
>   drivers/clk/mediatek/clk-mt7622-apmixedsys.c | 2 +-
>   drivers/clk/mediatek/clk-mt7629.c            | 2 +-
>   drivers/clk/mediatek/clk-mt7981-apmixed.c    | 2 +-
>   drivers/clk/mediatek/clk-mt7986-apmixed.c    | 2 +-
>   drivers/clk/mediatek/clk-mt7988-apmixed.c    | 2 +-
>   drivers/clk/mediatek/clk-mt8135-apmixedsys.c | 3 ++-
>   drivers/clk/mediatek/clk-mt8167-apmixedsys.c | 2 +-
>   drivers/clk/mediatek/clk-mt8183-apmixedsys.c | 2 +-
>   drivers/clk/mediatek/clk-mt8188-apmixedsys.c | 2 +-
>   drivers/clk/mediatek/clk-mt8195-apusys_pll.c | 3 ++-
>   drivers/clk/mediatek/clk-mt8196-apmixedsys.c | 3 ++-
>   drivers/clk/mediatek/clk-mt8196-mcu.c        | 2 +-
>   drivers/clk/mediatek/clk-mt8196-mfg.c        | 2 +-
>   drivers/clk/mediatek/clk-mt8196-vlpckgen.c   | 2 +-
>   drivers/clk/mediatek/clk-mt8365-apmixedsys.c | 2 +-
>   drivers/clk/mediatek/clk-mt8516-apmixedsys.c | 2 +-
>   drivers/clk/mediatek/clk-pll.c               | 7 ++++---
>   drivers/clk/mediatek/clk-pll.h               | 6 +++---
>   24 files changed, 33 insertions(+), 29 deletions(-)
> 

..snip..

> 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;
>   };
>   

There's a forward declaration of struct device_node in this header: with this
change, that becomes unused.

Please change that to a forward declaration of struct device instead.

While at it, I'd appreciate if you could either:
  A. Remove the forward declaration for `struct clk_hw_onecell_data` and for
     `struct clk_ops` (as both come from clk-provider.h - which this already
      includes);
    ...or...
  B. Remove the inclusion of clk-provider.h and keep the forward declarations.

After which:

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

> -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);
>   
> 




  parent reply	other threads:[~2025-10-09  8:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-08 16:05 [PATCH v2 0/5] MediaTek PLL Refactors and Fixes Nicolas Frattaroli
2025-10-08 16:05 ` [PATCH v2 1/5] clk: Respect CLK_OPS_PARENT_ENABLE during recalc Nicolas Frattaroli
2025-10-09  7:07   ` Chen-Yu Tsai
2025-10-09  8:01   ` AngeloGioacchino Del Regno
2025-10-08 16:05 ` [PATCH v2 2/5] clk: mediatek: Refactor pll registration to pass device Nicolas Frattaroli
2025-10-09  7:09   ` Chen-Yu Tsai
2025-10-09  7:19   ` Chen-Yu Tsai
2025-10-09  8:09   ` AngeloGioacchino Del Regno [this message]
2025-10-09  8:18     ` Chen-Yu Tsai
2025-10-09  8:52       ` AngeloGioacchino Del Regno
2025-10-10 20:11       ` Nicolas Frattaroli
2025-10-08 16:05 ` [PATCH v2 3/5] clk: mediatek: Pass device to clk_hw_register for PLLs Nicolas Frattaroli
2025-10-09  8:11   ` AngeloGioacchino Del Regno
2025-10-09  8:32   ` Chen-Yu Tsai
2025-10-08 16:05 ` [PATCH v2 4/5] clk: mediatek: Refactor pllfh registration to pass device Nicolas Frattaroli
2025-10-09  7:33   ` Chen-Yu Tsai
2025-10-10 20:06     ` Nicolas Frattaroli
2025-10-09  8:12   ` AngeloGioacchino Del Regno
2025-10-08 16:05 ` [PATCH v2 5/5] clk: mediatek: Add mfg_eb as parent to mt8196 mfgpll clocks Nicolas Frattaroli
2025-10-09  8:22   ` AngeloGioacchino Del Regno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2477df4e-c89e-408f-bb2a-d5af51f78ef8@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=aisheng.dong@nxp.com \
    --cc=kernel@collabora.com \
    --cc=laura.nao@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mturquette@baylibre.com \
    --cc=nfraprado@collabora.com \
    --cc=nicolas.frattaroli@collabora.com \
    --cc=olvaffe@gmail.com \
    --cc=sboyd@codeaurora.org \
    --cc=sboyd@kernel.org \
    --cc=wenst@chromium.org \
    --cc=y.oudjana@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox