From: Leonard Crestez <leonard.crestez@nxp.com>
To: Peng Fan <peng.fan@nxp.com>, Abel Vesa <abel.vesa@nxp.com>
Cc: Jacky Bai <ping.bai@nxp.com>, Anson Huang <anson.huang@nxp.com>,
"sboyd@kernel.org" <sboyd@kernel.org>,
Shawn Guo <shawnguo@kernel.org>,
"mturquette@baylibre.com" <mturquette@baylibre.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
dl-linux-imx <linux-imx@nxp.com>,
"kernel@pengutronix.de" <kernel@pengutronix.de>,
"festevam@gmail.com" <festevam@gmail.com>,
"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 1/7] clk: imx: clk-pll14xx: Switch to clk_hw based API
Date: Mon, 2 Dec 2019 05:07:48 +0000 [thread overview]
Message-ID: <VI1PR04MB7023CAEB8ADA6B1CA0907A72EE430@VI1PR04MB7023.eurprd04.prod.outlook.com> (raw)
In-Reply-To: AM0PR04MB4481B7D74A1861558523F21488430@AM0PR04MB4481.eurprd04.prod.outlook.com
On 2019-12-02 4:26 AM, Peng Fan wrote:
>> Subject: Re: [PATCH 1/7] clk: imx: clk-pll14xx: Switch to clk_hw based API
>> On Tue, Oct 29, 2019 at 01:40:54PM +0000, Peng Fan wrote:
>>> From: Peng Fan <peng.fan@nxp.com>
>>>
>>> Switch the imx_clk_pll14xx function to clk_hw based API, rename
>>> accordingly and add a macro for clk based legacy. This allows us to
>>> move closer to a clear split between consumer and provider clk APIs.
>>>
>>> diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h index
>>> bc5bb6ac8636..5038622f1a72 100644
>>> --- a/drivers/clk/imx/clk.h
>>> +++ b/drivers/clk/imx/clk.h
>>> @@ -97,8 +97,12 @@ extern struct imx_pll14xx_clk imx_1443x_pll;
>>> #define imx_clk_mux(name, reg, shift, width, parents, num_parents) \
>>> imx_clk_hw_mux(name, reg, shift, width, parents, num_parents)->clk
>>>
>>> -struct clk *imx_clk_pll14xx(const char *name, const char *parent_name,
>>> - void __iomem *base, const struct imx_pll14xx_clk *pll_clk);
>>> +#define imx_clk_pll14xx(name, parent_name, base, pll_clk) \
>>> + imx_clk_hw_pll14xx(name, parent_name, base, pll_clk)->clk
>>> +
>>
>> I would suggest to use an inline function for this, which will be more readable
>> and complying to kernel coding style.
>
> ok, I'll send out v2.
Blindly dereferencing ->clk will crash instead of propagating errors so
you might want to use the to_clk helper from here:
https://patchwork.kernel.org/patch/11257811/
--
Regards,
Leonard
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-12-02 5:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-29 13:40 [PATCH 0/7] clk: imx: switch to clk_hw based API Peng Fan
2019-10-29 13:40 ` [PATCH 1/7] clk: imx: clk-pll14xx: Switch " Peng Fan
2019-12-02 1:17 ` Shawn Guo
2019-12-02 2:26 ` Peng Fan
2019-12-02 5:07 ` Leonard Crestez [this message]
2019-12-02 5:11 ` Peng Fan
2019-10-29 13:41 ` [PATCH 2/7] clk: imx: clk-composite-8m: " Peng Fan
2019-10-29 13:41 ` [PATCH 3/7] clk: imx: add imx_unregister_hw_clocks Peng Fan
2019-10-29 13:41 ` [PATCH 4/7] clk: imx: add hw API imx_clk_hw_mux2_flags Peng Fan
2019-10-29 13:41 ` [PATCH 5/7] clk: imx: frac-pll: Switch to clk_hw based API Peng Fan
2019-10-29 13:41 ` [PATCH 6/7] clk: imx: sccg-pll: " Peng Fan
2019-10-29 13:41 ` [PATCH 7/7] clk: imx: gate3: " Peng Fan
2019-10-30 10:21 ` [PATCH 0/7] clk: imx: switch " Abel Vesa
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=VI1PR04MB7023CAEB8ADA6B1CA0907A72EE430@VI1PR04MB7023.eurprd04.prod.outlook.com \
--to=leonard.crestez@nxp.com \
--cc=abel.vesa@nxp.com \
--cc=anson.huang@nxp.com \
--cc=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=peng.fan@nxp.com \
--cc=ping.bai@nxp.com \
--cc=s.hauer@pengutronix.de \
--cc=sboyd@kernel.org \
--cc=shawnguo@kernel.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).