* Re: [PATCH v6 2/2] mfd: mxs-lradc: Convert to devm_clk_get_enabled()
[not found] <20261127180709.315826-2-festevam@gmail.com>
@ 2026-11-28 12:13 ` Markus Elfring
2026-11-28 12:48 ` Markus Elfring
1 sibling, 0 replies; 2+ messages in thread
From: Markus Elfring @ 2026-11-28 12:13 UTC (permalink / raw)
To: Fabio Estevam, mfd, imx, Lee Jones
Cc: LKML, kernel-janitors, Andy Shevchenko, Christophe Jaillet,
Frank Li, Jonathan Cameron, Jonathan Cameron, Julia Lawall
…
> This conversion makes the code simpler.
…
> +++ b/drivers/mfd/mxs-lradc.c
> @@ -160,17 +160,10 @@ static int mxs_lradc_probe(struct platform_device *pdev)
> if (IS_ERR(lradc->base))
> return PTR_ERR(lradc->base);
>
> - lradc->clk = devm_clk_get(&pdev->dev, NULL);
> - if (IS_ERR(lradc->clk)) {
> - dev_err(dev, "Failed to get the delay unit clock\n");
> - return PTR_ERR(lradc->clk);
> - }
> -
> - ret = clk_prepare_enable(lradc->clk);
> - if (ret) {
> - dev_err(dev, "Failed to enable the delay unit clock\n");
> - return ret;
> - }
> + lradc->clk = devm_clk_get_enabled(dev, NULL);
…
How do you think about to use the local variable “dev” in the implementation of
the function “mxs_lradc_probe” consistently?
Is there a need to adjust further source code places?
https://elixir.bootlin.com/linux/v7.4-rc2/source/drivers/mfd/mxs-lradc.c#L126-L231
Regards,
Markus
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v6 2/2] mfd: mxs-lradc: Convert to devm_clk_get_enabled()
[not found] <20261127180709.315826-2-festevam@gmail.com>
2026-11-28 12:13 ` [PATCH v6 2/2] mfd: mxs-lradc: Convert to devm_clk_get_enabled() Markus Elfring
@ 2026-11-28 12:48 ` Markus Elfring
1 sibling, 0 replies; 2+ messages in thread
From: Markus Elfring @ 2026-11-28 12:48 UTC (permalink / raw)
To: Fabio Estevam, mfd, imx, Lee Jones
Cc: LKML, kernel-janitors, Andy Shevchenko, Christophe Jaillet,
Frank Li, Jonathan Cameron, Jonathan Cameron
> The LRADC clock is acquired with a managed helper but enabled and
> disabled manually.
>
> Acquire the LRADC clock with devm_clk_get_enabled() instead of a bare
> devm_clk_get() followed by a manual clk_prepare_enable(), so it is
> prepared/enabled for the device lifetime and released on unbind.
>
> This conversion makes the code simpler.
Is it still required to store the clock object within the data structure?
https://elixir.bootlin.com/linux/v7.4-rc2/source/include/linux/mfd/mxs-lradc.h#L150-L164
Would a local variable become sufficient after the proposed source code transformation?
https://elixir.bootlin.com/linux/v7.4-rc2/source/drivers/mfd/mxs-lradc.c#L126-L231
Regards,
Markus
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-28 12:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20261127180709.315826-2-festevam@gmail.com>
2026-11-28 12:13 ` [PATCH v6 2/2] mfd: mxs-lradc: Convert to devm_clk_get_enabled() Markus Elfring
2026-11-28 12:48 ` Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®