* [PATCH v9 0/4] clk: provide new devm helpers for prepared and enabled clocks @ 2022-05-20 7:57 Uwe Kleine-König 2022-05-20 7:57 ` [PATCH v9 4/4] clk: meson: axg-audio: Don't duplicate devm_clk_get_enabled() Uwe Kleine-König 2022-06-07 11:08 ` [PATCH v9 0/4] clk: provide new devm helpers for prepared and enabled clocks Uwe Kleine-König 0 siblings, 2 replies; 5+ messages in thread From: Uwe Kleine-König @ 2022-05-20 7:57 UTC (permalink / raw) To: Russell King, Stephen Boyd Cc: linux-clk, kernel, Michael Turquette, Jonathan Cameron, Alexandru Ardelean, Neil Armstrong, Jerome Brunet, Kevin Hilman, Martin Blumenstingl, linux-amlogic Hello, after Stephen signaled to accept the idea, this is a rework of v8[1] with the following changes: - Drop the follow up conversions. I will resend them individually per subsystem once the preconditions from this v9 are in. I only kept one clk patch that will go in via the clk tree anyhow. I trimmed the Cc: list accordingly. - (trivially) rebased to v5.18-rc1 - Introduce a new commit that first improves the documention of devm_clk_get() and devm_clk_get_optional() before (mostly) duplicating these for the new functions. - Make the new functions use a GPL export. (Note the existing functions use a plain export, I didn't change that.) - Drop a bogus empty line that was cut-n-pasted into several functions. Thanks for feedback by Stephen and Jonathan. @Russell: Stephen wrote in v8: "I'm largely waiting for Russell to ack the clk.h change [...]". Would be great if you looked at the series and tell us your thoughts. @Stephen: You asked to add the acks from v8. There were however only acks for the followup conversions. So no changes here. (Andy Shevchenko replied to patch 0, but his Reviewed-by: only affected the patch "iio: Make use of devm_clk_get_enabled()".) Best regards Uwe [1] https://lore.kernel.org/linux-clk/20220314141643.22184-1-u.kleine-koenig@pengutronix.de Uwe Kleine-König (4): clk: Improve documentation for devm_clk_get() and its optional variant clk: generalize devm_clk_get() a bit clk: Provide new devm_clk helpers for prepared and enabled clocks clk: meson: axg-audio: Don't duplicate devm_clk_get_enabled() drivers/clk/clk-devres.c | 91 +++++++++++++++++++---- drivers/clk/meson/axg-audio.c | 36 +-------- include/linux/clk.h | 134 ++++++++++++++++++++++++++++++++-- 3 files changed, 207 insertions(+), 54 deletions(-) base-commit: 3123109284176b1532874591f7c81f3837bbdc17 -- 2.35.1 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v9 4/4] clk: meson: axg-audio: Don't duplicate devm_clk_get_enabled() 2022-05-20 7:57 [PATCH v9 0/4] clk: provide new devm helpers for prepared and enabled clocks Uwe Kleine-König @ 2022-05-20 7:57 ` Uwe Kleine-König 2022-06-16 2:37 ` Stephen Boyd 2022-06-07 11:08 ` [PATCH v9 0/4] clk: provide new devm helpers for prepared and enabled clocks Uwe Kleine-König 1 sibling, 1 reply; 5+ messages in thread From: Uwe Kleine-König @ 2022-05-20 7:57 UTC (permalink / raw) To: Russell King, Stephen Boyd Cc: linux-clk, kernel, Michael Turquette, Jonathan Cameron, Alexandru Ardelean, Neil Armstrong, Jerome Brunet, Kevin Hilman, Martin Blumenstingl, linux-amlogic The clk API just got a function with a slightly different name and the same functionality. Remove the duplication. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- drivers/clk/meson/axg-audio.c | 36 ++++------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/drivers/clk/meson/axg-audio.c b/drivers/clk/meson/axg-audio.c index bfe36bd41339..5016682e47c8 100644 --- a/drivers/clk/meson/axg-audio.c +++ b/drivers/clk/meson/axg-audio.c @@ -1657,35 +1657,6 @@ static struct clk_regmap *const sm1_clk_regmaps[] = { &sm1_sysclk_b_en, }; -static int devm_clk_get_enable(struct device *dev, char *id) -{ - struct clk *clk; - int ret; - - clk = devm_clk_get(dev, id); - if (IS_ERR(clk)) { - ret = PTR_ERR(clk); - dev_err_probe(dev, ret, "failed to get %s", id); - return ret; - } - - ret = clk_prepare_enable(clk); - if (ret) { - dev_err(dev, "failed to enable %s", id); - return ret; - } - - ret = devm_add_action_or_reset(dev, - (void(*)(void *))clk_disable_unprepare, - clk); - if (ret) { - dev_err(dev, "failed to add reset action on %s", id); - return ret; - } - - return 0; -} - struct axg_audio_reset_data { struct reset_controller_dev rstc; struct regmap *map; @@ -1787,6 +1758,7 @@ static int axg_audio_clkc_probe(struct platform_device *pdev) struct regmap *map; void __iomem *regs; struct clk_hw *hw; + struct clk *clk; int ret, i; data = of_device_get_match_data(dev); @@ -1804,9 +1776,9 @@ static int axg_audio_clkc_probe(struct platform_device *pdev) } /* Get the mandatory peripheral clock */ - ret = devm_clk_get_enable(dev, "pclk"); - if (ret) - return ret; + clk = devm_clk_get_enabled(dev, "pclk"); + if (IS_ERR(clk)) + return PTR_ERR(clk); ret = device_reset(dev); if (ret) { -- 2.35.1 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v9 4/4] clk: meson: axg-audio: Don't duplicate devm_clk_get_enabled() 2022-05-20 7:57 ` [PATCH v9 4/4] clk: meson: axg-audio: Don't duplicate devm_clk_get_enabled() Uwe Kleine-König @ 2022-06-16 2:37 ` Stephen Boyd 0 siblings, 0 replies; 5+ messages in thread From: Stephen Boyd @ 2022-06-16 2:37 UTC (permalink / raw) To: Russell King, Uwe Kleine-König Cc: linux-clk, kernel, Michael Turquette, Jonathan Cameron, Alexandru Ardelean, Neil Armstrong, Jerome Brunet, Kevin Hilman, Martin Blumenstingl, linux-amlogic Quoting Uwe Kleine-König (2022-05-20 00:57:37) > The clk API just got a function with a slightly different name and > the same functionality. Remove the duplication. > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > --- Applied to clk-next _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v9 0/4] clk: provide new devm helpers for prepared and enabled clocks 2022-05-20 7:57 [PATCH v9 0/4] clk: provide new devm helpers for prepared and enabled clocks Uwe Kleine-König 2022-05-20 7:57 ` [PATCH v9 4/4] clk: meson: axg-audio: Don't duplicate devm_clk_get_enabled() Uwe Kleine-König @ 2022-06-07 11:08 ` Uwe Kleine-König 2022-06-07 11:42 ` Russell King (Oracle) 1 sibling, 1 reply; 5+ messages in thread From: Uwe Kleine-König @ 2022-06-07 11:08 UTC (permalink / raw) To: Russell King, Stephen Boyd Cc: Neil Armstrong, Martin Blumenstingl, Kevin Hilman, Michael Turquette, Alexandru Ardelean, kernel, linux-amlogic, linux-clk, Jonathan Cameron, Jerome Brunet [-- Attachment #1.1: Type: text/plain, Size: 1696 bytes --] Hello, On Fri, May 20, 2022 at 09:57:33AM +0200, Uwe Kleine-König wrote: > after Stephen signaled to accept the idea, this is a rework of v8[1] with > the following changes: > > - Drop the follow up conversions. I will resend them individually per > subsystem once the preconditions from this v9 are in. I only kept one > clk patch that will go in via the clk tree anyhow. I trimmed the Cc: > list accordingly. > > - (trivially) rebased to v5.18-rc1 > > - Introduce a new commit that first improves the documention of > devm_clk_get() and devm_clk_get_optional() before (mostly) > duplicating these for the new functions. > > - Make the new functions use a GPL export. (Note the existing functions > use a plain export, I didn't change that.) > > - Drop a bogus empty line that was cut-n-pasted into several functions. > > Thanks for feedback by Stephen and Jonathan. > > @Russell: Stephen wrote in v8: "I'm largely waiting for Russell to ack > the clk.h change [...]". Would be great if you looked at the series and > tell us your thoughts. That didn't happen :-\ > @Stephen: You asked to add the acks from v8. There were however only > acks for the followup conversions. So no changes here. > (Andy Shevchenko replied to patch 0, but his Reviewed-by: only affected > the patch "iio: Make use of devm_clk_get_enabled()".) Hmm, I somehow expected this series to go into v5.19-rc1, but it didn't :-\. Is there anything still needed from my side? Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ | [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] [-- Attachment #2: Type: text/plain, Size: 167 bytes --] _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v9 0/4] clk: provide new devm helpers for prepared and enabled clocks 2022-06-07 11:08 ` [PATCH v9 0/4] clk: provide new devm helpers for prepared and enabled clocks Uwe Kleine-König @ 2022-06-07 11:42 ` Russell King (Oracle) 0 siblings, 0 replies; 5+ messages in thread From: Russell King (Oracle) @ 2022-06-07 11:42 UTC (permalink / raw) To: Uwe Kleine-König Cc: Stephen Boyd, Neil Armstrong, Martin Blumenstingl, Kevin Hilman, Michael Turquette, Alexandru Ardelean, kernel, linux-amlogic, linux-clk, Jonathan Cameron, Jerome Brunet On Tue, Jun 07, 2022 at 01:08:16PM +0200, Uwe Kleine-König wrote: > Hello, > > On Fri, May 20, 2022 at 09:57:33AM +0200, Uwe Kleine-König wrote: > > after Stephen signaled to accept the idea, this is a rework of v8[1] with > > the following changes: > > > > - Drop the follow up conversions. I will resend them individually per > > subsystem once the preconditions from this v9 are in. I only kept one > > clk patch that will go in via the clk tree anyhow. I trimmed the Cc: > > list accordingly. > > > > - (trivially) rebased to v5.18-rc1 > > > > - Introduce a new commit that first improves the documention of > > devm_clk_get() and devm_clk_get_optional() before (mostly) > > duplicating these for the new functions. > > > > - Make the new functions use a GPL export. (Note the existing functions > > use a plain export, I didn't change that.) > > > > - Drop a bogus empty line that was cut-n-pasted into several functions. > > > > Thanks for feedback by Stephen and Jonathan. > > > > @Russell: Stephen wrote in v8: "I'm largely waiting for Russell to ack > > the clk.h change [...]". Would be great if you looked at the series and > > tell us your thoughts. > > That didn't happen :-\ Sorry, I missed this patch set. I haven't been reading lakml very much for *all* of May - commitments have meant I haven't had very little time to look at stuff on the mailing list, and due to the volume of email, I don't do "catch up" anymore. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-06-16 2:38 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-05-20 7:57 [PATCH v9 0/4] clk: provide new devm helpers for prepared and enabled clocks Uwe Kleine-König 2022-05-20 7:57 ` [PATCH v9 4/4] clk: meson: axg-audio: Don't duplicate devm_clk_get_enabled() Uwe Kleine-König 2022-06-16 2:37 ` Stephen Boyd 2022-06-07 11:08 ` [PATCH v9 0/4] clk: provide new devm helpers for prepared and enabled clocks Uwe Kleine-König 2022-06-07 11:42 ` Russell King (Oracle)
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).