linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Chen-Yu Tsai <wenst@chromium.org>,
	Michael Turquette <mturquette@baylibre.com>
Cc: Chen-Yu Tsai <wenst@chromium.org>,
	Chun-Jie Chen <chun-jie.chen@mediatek.com>,
	Miles Chen <miles.chen@mediatek.com>,
	Rex-BC Chen <rex-bc.chen@mediatek.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	linux-clk@vger.kernel.org, linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/5] clk: mediatek: Replace 'struct clk' with 'struct clk_hw'
Date: Thu, 19 May 2022 17:37:21 -0700	[thread overview]
Message-ID: <20220520003724.DD88EC385AA@smtp.kernel.org> (raw)
In-Reply-To: <20220519071610.423372-4-wenst@chromium.org>

Quoting Chen-Yu Tsai (2022-05-19 00:16:08)
> As part of the effort to improve the MediaTek clk drivers, the next step
> is to switch from the old 'struct clk' clk prodivder APIs to the new
> 'struct clk_hw' ones.
> 
> Instead of adding new APIs to the MediaTek clk driver library mirroring
> the existing ones, moving all drivers to the new APIs, and then removing
> the old ones, just migrate everything at the same time. This involves
> replacing 'struct clk' with 'struct clk_hw', and 'struct clk_onecell_data'
> with 'struct clk_hw_onecell_data', and fixing up all usages.
> 
> For now, the clk_register() and co. usage is retained, with __clk_get_hw()
> and (struct clk_hw *)->clk used to bridge the difference between the APIs.
> These will be replaced in subsequent patches.
> 
> Fix up mtk_{alloc,free}_clk_data to use 'struct clk_hw' by hand. Fix up
> all other affected call sites with the following coccinelle script.
> 
>     // Replace type
>     @@
>     @@
>     - struct clk_onecell_data
>     + struct clk_hw_onecell_data
> 
>     // Replace of_clk_add_provider() & of_clk_src_simple_get()
>     @@
>     expression NP, DATA;
>     symbol of_clk_src_onecell_get;
>     @@
>     - of_clk_add_provider(
>     + of_clk_add_hw_provider(
>             NP,
>     -   of_clk_src_onecell_get,
>     +   of_clk_hw_onecell_get,
>             DATA
>       )
> 
>     // Fix register/unregister
>     @@
>     identifier CD;
>     expression E;
>     identifier fn =~ "unregister";
>     @@
>       fn(...,
>     -    CD->clks[E]
>     +    CD->hws[E]->clk
>          ,...
>         );
> 
>     // Fix calls to clk_prepare_enable()
>     @@
>     identifier CD;
>     expression E;
>     @@
>       clk_prepare_enable(
>     -                CD->clks[E]
>     +                CD->hws[E]->clk
>       );
> 
>     // Fix pointer assignment
>     @@
>     identifier CD;
>     identifier CLK;
>     expression E;
>     @@
>     - CD->clks[E]
>     + CD->hws[E]
>       =
>     (
>     - CLK
>     + __clk_get_hw(CLK)
>     |
>       ERR_PTR(...)
>     )
>       ;
> 
>     // Fix pointer usage
>     @@
>     identifier CD;
>     expression E;
>     @@
>     - CD->clks[E]
>     + CD->hws[E]
> 
>     // Fix mtk_clk_pll_get_base()
>     @@
>     symbol clk, hw, data;
>     @@
>       mtk_clk_pll_get_base(
>     -                  struct clk *clk,
>     +                  struct clk_hw *hw,
>                            const struct mtk_pll_data *data
>       ) {
>     - struct clk_hw *hw = __clk_get_hw(clk);
>       ...
>       }
> 
>     // Fix mtk_clk_pll_get_base() usage
>     @@
>     identifier CD;
>     expression E;
>     @@
>       mtk_clk_pll_get_base(
>     -    CD->clks[E]
>     +    CD->hws[E]->clk
>          ,...
>       );
> 
> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> Reviewed-by: Miles Chen <miles.chen@mediatek.com>
> Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> Tested-by: Miles Chen <miles.chen@mediatek.com>
> ---

Applied to clk-next

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      parent reply	other threads:[~2022-05-20  0:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-19  7:16 [PATCH v3 0/5] clk: mediatek: Move to struct clk_hw provider APIs Chen-Yu Tsai
2022-05-19  7:16 ` [PATCH v3 1/5] clk: mediatek: Make mtk_clk_register_composite() static Chen-Yu Tsai
2022-05-20  0:36   ` Stephen Boyd
2022-05-19  7:16 ` [PATCH v3 2/5] clk: mediatek: apmixed: Drop error message from clk_register() failure Chen-Yu Tsai
2022-05-20  0:37   ` Stephen Boyd
2022-05-19  7:16 ` [PATCH v3 4/5] clk: mediatek: Switch to clk_hw provider APIs Chen-Yu Tsai
2022-05-20  0:37   ` Stephen Boyd
2022-05-19  7:16 ` [PATCH v3 5/5] clk: mediatek: mt8173: " Chen-Yu Tsai
2022-05-20  0:37   ` Stephen Boyd
     [not found] ` <20220519071610.423372-4-wenst@chromium.org>
2022-05-20  0:37   ` Stephen Boyd [this message]

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=20220520003724.DD88EC385AA@smtp.kernel.org \
    --to=sboyd@kernel.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=chun-jie.chen@mediatek.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=miles.chen@mediatek.com \
    --cc=mturquette@baylibre.com \
    --cc=rex-bc.chen@mediatek.com \
    --cc=wenst@chromium.org \
    /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;
as well as URLs for NNTP newsgroup(s).