Thread (20 messages) 20 messages, 5 authors, 2024-08-22

Re: [PATCH 4/8] tty: atmel_serial: Use devm_clk_get_enabled() helpers

From: Alexandre Belloni <alexandre.belloni@bootlin.com>
Date: 2024-08-22 14:33:21
Also in: linux-mips, linux-serial, linux-tegra, lkml

On 22/08/2024 16:34:28+0300, Andy Shevchenko wrote:
On Thu, Aug 22, 2024 at 03:28:40PM +0200, Richard GENOUD wrote:
quoted
Le 22/08/2024 à 05:39, Lei Liu a écrit :
quoted
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().
...
quoted
quoted
  	 * The peripheral clock can now safely be disabled till the port
  	 * is used
  	 */
-	clk_disable_unprepare(atmel_port->clk);
-
Why removing this ?
This is not an error path.
Good point, I wouldn't apply this patch as well as a few others in this series
due to this reason.

Instead it might make sense to add a comment on top of devm_clk_get() to
explain why _enabled() variant is *not* used.
Or maybe stop doing brainded conversions to new APIs.
-- 
With Best Regards,
Andy Shevchenko
-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help