[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1jikkmkewj.fsf@starbuckisacylon.baylibre.com>
Date: Mon, 23 Jun 2025 11:04:12 +0200
From: Jerome Brunet <jbrunet@...libre.com>
To: Frank Li <Frank.li@....com>
Cc: Vladimir Kondratiev <vladimir.kondratiev@...ileye.com>, Gregory CLEMENT
<gregory.clement@...tlin.com>, Théo Lebrun
<theo.lebrun@...tlin.com>,
Michael Turquette <mturquette@...libre.com>, Stephen Boyd
<sboyd@...nel.org>, Philipp Zabel <p.zabel@...gutronix.de>, Abel Vesa
<abelvesa@...nel.org>, Peng Fan <peng.fan@....com>, Shawn Guo
<shawnguo@...nel.org>, Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>, Fabio Estevam
<festevam@...il.com>, Neil Armstrong <neil.armstrong@...aro.org>, Kevin
Hilman <khilman@...libre.com>, Martin Blumenstingl
<martin.blumenstingl@...glemail.com>, linux-mips@...r.kernel.org,
linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org,
imx@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org,
linux-amlogic@...ts.infradead.org
Subject: Re: [PATCH 3/4] clk: clk-imx8mp-audiomix: use the auxiliary device
creation helper
On Wed 11 Jun 2025 at 12:48, Frank Li <Frank.li@....com> wrote:
> On Wed, Jun 11, 2025 at 02:53:58PM +0200, Jerome Brunet wrote:
>> The auxiliary device creation of this driver is simple enough to
>> use the available auxiliary device creation helper.
>>
>> Use it and remove some boilerplate code.
>
> Actaully, you also remove unused struct clk_imx8mp_audiomix_priv *priv
> at clk_imx8mp_audiomix_reset_controller_register().
>
> Please add it into comments.
That's merely a side effect of removing the boilerplate code.
Like for the other changes of the same kind, I don't think listing the
symbols removed would be useful to the change description
>
> Reviewed-by: Frank Li <Frank.Li@....com>
>
>>
>> Signed-off-by: Jerome Brunet <jbrunet@...libre.com>
>> ---
>> drivers/clk/imx/clk-imx8mp-audiomix.c | 49 ++++++-----------------------------
>> 1 file changed, 8 insertions(+), 41 deletions(-)
>>
>> diff --git a/drivers/clk/imx/clk-imx8mp-audiomix.c b/drivers/clk/imx/clk-imx8mp-audiomix.c
>> index 775f62dddb11d8cfd17a4ebf7a677ef399c5e617..765fb1f5bd4fa2b039d7414abd89471438ee41dd 100644
>> --- a/drivers/clk/imx/clk-imx8mp-audiomix.c
>> +++ b/drivers/clk/imx/clk-imx8mp-audiomix.c
>> @@ -230,61 +230,28 @@ struct clk_imx8mp_audiomix_priv {
>>
>> #if IS_ENABLED(CONFIG_RESET_CONTROLLER)
>>
>> -static void clk_imx8mp_audiomix_reset_unregister_adev(void *_adev)
>> +static int clk_imx8mp_audiomix_reset_controller_register(struct device *dev)
>> {
>> - struct auxiliary_device *adev = _adev;
>> -
>> - auxiliary_device_delete(adev);
>> - auxiliary_device_uninit(adev);
>> -}
>> -
>> -static void clk_imx8mp_audiomix_reset_adev_release(struct device *dev)
>> -{
>> - struct auxiliary_device *adev = to_auxiliary_dev(dev);
>> -
>> - kfree(adev);
>> -}
>> -
>> -static int clk_imx8mp_audiomix_reset_controller_register(struct device *dev,
>> - struct clk_imx8mp_audiomix_priv *priv)
>> -{
>> - struct auxiliary_device *adev __free(kfree) = NULL;
>> - int ret;
>> + struct auxiliary_device *adev;
>>
>> if (!of_property_present(dev->of_node, "#reset-cells"))
>> return 0;
>>
>> - adev = kzalloc(sizeof(*adev), GFP_KERNEL);
>> + adev = devm_auxiliary_device_create(dev, "reset", NULL);
>> if (!adev)
>> - return -ENOMEM;
>> -
>> - adev->name = "reset";
>> - adev->dev.parent = dev;
>> - adev->dev.release = clk_imx8mp_audiomix_reset_adev_release;
>> -
>> - ret = auxiliary_device_init(adev);
>> - if (ret)
>> - return ret;
>> + return -ENODEV;
>>
>> - ret = auxiliary_device_add(adev);
>> - if (ret) {
>> - auxiliary_device_uninit(adev);
>> - return ret;
>> - }
>> -
>> - return devm_add_action_or_reset(dev, clk_imx8mp_audiomix_reset_unregister_adev,
>> - no_free_ptr(adev));
>> + return 0;
>> }
>>
>> #else /* !CONFIG_RESET_CONTROLLER */
>>
>> -static int clk_imx8mp_audiomix_reset_controller_register(struct device *dev,
>> - struct clk_imx8mp_audiomix_priv *priv)
>> +static int clk_imx8mp_audiomix_reset_controller_register(struct device *dev)
>> {
>> return 0;
>> }
>>
>> -#endif /* !CONFIG_RESET_CONTROLLER */
>> +#endif
>>
>> static void clk_imx8mp_audiomix_save_restore(struct device *dev, bool save)
>> {
>> @@ -408,7 +375,7 @@ static int clk_imx8mp_audiomix_probe(struct platform_device *pdev)
>> if (ret)
>> goto err_clk_register;
>>
>> - ret = clk_imx8mp_audiomix_reset_controller_register(dev, priv);
>> + ret = clk_imx8mp_audiomix_reset_controller_register(dev);
>> if (ret)
>> goto err_clk_register;
>>
>>
>> --
>> 2.47.2
>>
--
Jerome
Powered by blists - more mailing lists