Re: [PATCH v3 2/3] PM: runtime: add devm_pm_clk_create helper

From: Geert Uytterhoeven
Date: Tue Aug 31 2021 - 08:15:54 EST


Hi Dmitry,

Thanks for your patch!

On Sat, Jul 31, 2021 at 9:51 PM Dmitry Baryshkov
<dmitry.baryshkov@xxxxxxxxxx> wrote:
> A typical code pattern for pm_clk_create() call is to call it in the
> _probe function and to call pm_clk_destroy() both from _probe error path
> and from _remove function. For some drivers the whole remove function
> would consist of the call to pm_remove_disable().

Is it? I could find only one (drivers/clk/mmp/clk-audio.c).
All other users call it from their PM Domain .attach_dev() callback,
which cannot become managed.

> Add helper function to replace this bolierplate piece of code. Calling
> devm_pm_clk_create() removes the need for calling pm_clk_destroy() both
> in the probe()'s error path and in the remove() function.
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx>

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds