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

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

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: 2024-08-22 13:35:54
Also in: linux-mips, linux-serial, linux-tegra, lkml

On Thu, Aug 22, 2024 at 03:28:40PM +0200, Richard GENOUD wrote:
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
  	 * 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.

-- 
With Best Regards,
Andy Shevchenko


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help