On 06/08/2021 10:08, Dmitry Baryshkov wrote:
On Fri, 6 Aug 2021 at 02:53, Stephen Boyd <sboyd@xxxxxxxxxx> wrote:
Quoting Dmitry Baryshkov (2021-07-31 12:50:31)
Most of the drivers using using pm_runtime_enable() or pm_clk_create()
follow the same pattern: call the function in the probe() path and call
correspondingly pm_runtime_disable() or pm_clk_destroy() from the
probe()'s error path and from the remove() function. This common code
pattern has several drawbacks. I.e. driver authors have to ensure that
the disable/destroy call in the error path really corresponds to the
proper error clause. Or that the disable/destroy call is not missed in
the remove() callback.
Add two devres helpers replacing these code patterns with relevant devm
function call, removing the need to call corresponding disable/destroy
functions. As an example modify Qualcomm clock controller code to use
new helpers. In this case we are able to drop error path and remove
functions completely, simplifying the drivers in question.
There are lots of folks on the To: line so I'm not sure who is supposed
to apply this. Please indicate which maintainer tree you're planning to
land a series through if it touches different areas of the tree.
I'd prefer for them to go through the clock tree.
Stephen, since Rafael has acked the patched, could you please take a
look and hopefully merge them?
--
With best wishes
Dmitry