[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bde84e3f-5f16-473a-9674-11bef0bb2c91@vivo.com>
Date: Thu, 22 Aug 2024 21:29:01 +0800
From: Lei Liu <liulei.rjpt@...o.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Paul Cercueil <paul@...pouillou.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>, Thierry Reding
<thierry.reding@...il.com>, Jonathan Hunter <jonathanh@...dia.com>,
Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
Richard Genoud <richard.genoud@...tlin.com>,
Nicolas Ferre <nicolas.ferre@...rochip.com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Claudiu Beznea <claudiu.beznea@...on.dev>, Liviu Dudau
<liviu.dudau@....com>, Sudeep Holla <sudeep.holla@....com>,
Lorenzo Pieralisi <lpieralisi@...nel.org>, Andreas Färber
<afaerber@...e.de>, Manivannan Sadhasivam
<manivannan.sadhasivam@...aro.org>,
Patrice Chotard <patrice.chotard@...s.st.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
John Ogness <john.ogness@...utronix.de>, Thomas Gleixner
<tglx@...utronix.de>, Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Jeff Johnson <quic_jjohnson@...cinc.com>,
Valentin Caron <valentin.caron@...s.st.com>,
Lino Sanfilippo <l.sanfilippo@...bus.com>,
Amelie Delaunay <amelie.delaunay@...s.st.com>, linux-mips@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org,
linux-tegra@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-actions@...ts.infradead.org, linux-stm32@...md-mailman.stormreply.com,
opensource.kernel@...o.com
Subject: Re: [PATCH 5/8] tty: mps2-uart: Use devm_clk_get_enabled() helpers
on 2024/8/22 21:19, Andy Shevchenko wrote:
> On Thu, Aug 22, 2024 at 11:39:09AM +0800, Lei Liu wrote:
>> The devm_clk_get_enabled() helpers:
>> - call devm_clk_get()
>> - call clk_prepare_enable() and register what is needed in order to
>> call clk_disable_unprepare() when needed, as a managed resource.
>>
>> This simplifies the code and avoids calls to clk_disable_unprepare().
> ...
>
>> - mps_port->clk = devm_clk_get(&pdev->dev, NULL);
>> + mps_port->clk = devm_clk_get_enabled(&pdev->dev, NULL);
>> if (IS_ERR(mps_port->clk))
>> return PTR_ERR(mps_port->clk);
>>
>> - ret = clk_prepare_enable(mps_port->clk);
>> - if (ret)
>> - return ret;
>> -
>> mps_port->port.uartclk = clk_get_rate(mps_port->clk);
>>
>> - clk_disable_unprepare(mps_port->clk);
> Your change is not equivalent. In case this clock is shared this may lead to
> run-time issues. Hence I don't think this patch is needed in this case.
> Instead, you may add a comment on top of devm_clk_get() to explain that we only
> need it be enabled to get clock rate in the probe.
Thank you for your suggestion. I will adopt your advice in the second
version of the patch and make no changes.
---
With Best Regards,
Lei Liu
Powered by blists - more mailing lists