From: Frank Li <Frank.li@nxp.com>
To: Peng Fan <peng.fan@nxp.com>
Cc: Abel Vesa <abelvesa@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>, Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>,
Shengjiu Wang <shengjiu.wang@nxp.com>,
linux-clk@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] clk: imx: imx8mp-audiomix: Use the auxiliary device creation helper
Date: Wed, 22 Oct 2025 23:09:08 -0400 [thread overview]
Message-ID: <aPmcVGAtCZNaWnFo@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20251023-auxiliary-v1-1-0a16fa4c3cdd@nxp.com>
On Thu, Oct 23, 2025 at 09:49:32AM +0800, Peng Fan wrote:
> Use the auxiliary device creation helper to remove some boilerplate code.
clk: imx: imx8mp-audiomix: use devm_auxiliary_device_create() to simple code
Use helper function devm_auxiliary_device_create() to remove some
boilerplate code.
Reviewed-by: Frank Li <Frank.Li@nxp.com>
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
> drivers/clk/imx/clk-imx8mp-audiomix.c | 39 ++++-------------------------------
> 1 file changed, 4 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/clk/imx/clk-imx8mp-audiomix.c b/drivers/clk/imx/clk-imx8mp-audiomix.c
> index 775f62dddb11d8cfd17a4ebf7a677ef399c5e617..131702f2c9ecfd693af47094fe61b486ae6e8f6d 100644
> --- a/drivers/clk/imx/clk-imx8mp-audiomix.c
> +++ b/drivers/clk/imx/clk-imx8mp-audiomix.c
> @@ -230,50 +230,19 @@ struct clk_imx8mp_audiomix_priv {
>
> #if IS_ENABLED(CONFIG_RESET_CONTROLLER)
>
> -static void clk_imx8mp_audiomix_reset_unregister_adev(void *_adev)
> -{
> - 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 */
>
> ---
> base-commit: aaa9c3550b60d6259d6ea8b1175ade8d1242444e
> change-id: 20251023-auxiliary-3998bced9cb9
>
> Best regards,
> --
> Peng Fan <peng.fan@nxp.com>
>
next prev parent reply other threads:[~2025-10-23 3:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-23 1:49 [PATCH] clk: imx: imx8mp-audiomix: Use the auxiliary device creation helper Peng Fan
2025-10-23 3:09 ` Frank Li [this message]
2025-10-23 6:56 ` 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=aPmcVGAtCZNaWnFo@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=abelvesa@kernel.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=laurentiu.mihalcea@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=peng.fan@nxp.com \
--cc=s.hauer@pengutronix.de \
--cc=sboyd@kernel.org \
--cc=shawnguo@kernel.org \
--cc=shengjiu.wang@nxp.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