Skip to content

Commit

Permalink
clk: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
Browse files Browse the repository at this point in the history
Using pm_runtime_resume_and_get is more appropriate
for simplifing code

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Link: https://lore.kernel.org/r/20220418110455.2559264-1-chi.minghao@zte.com.cn
[sboyd@kernel.org: Drop local ret variable too]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
  • Loading branch information
Minghao Chi authored and Stephen Boyd committed Apr 23, 2022
1 parent bab7950 commit 3196a60
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions drivers/clk/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,10 @@ struct clk {
/*** runtime pm ***/
static int clk_pm_runtime_get(struct clk_core *core)
{
int ret;

if (!core->rpm_enabled)
return 0;

ret = pm_runtime_get_sync(core->dev);
if (ret < 0) {
pm_runtime_put_noidle(core->dev);
return ret;
}
return 0;
return pm_runtime_resume_and_get(core->dev);
}

static void clk_pm_runtime_put(struct clk_core *core)
Expand Down

0 comments on commit 3196a60

Please sign in to comment.