Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 772b0508 authored by Stephen Boyd's avatar Stephen Boyd Committed by Heiko Stuebner
Browse files

PM / clk: Do not __clk_get passed in clock-references



Clock references are on a per-user basis now, so they are not supposed
to be refcounted by itself anymore. Therefore multiple cascaded get and
put calls will fail.

When a clock reference gets passed into pm_clk_add_clk we can assume
that the pm clock handling will take control of the clock reference,
so after this functions returns the caller should've given up control
of that handle.

So remove the additional call to __clk_get() in __pm_clk_add().

The only current user of pm_clk_add_clk is drivers/clk/shmobile/clk-mstp.c
which already follows this paradigm by only getting the clock but not
puting it after passing the reference into pm_clk_add_clk.

In the error case the caller is expected to clean up the clock, as it
may very well try to do something different if pm_clk_add_clk() fails.

Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
[add commit-message]
Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 6ff33f39
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment