mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
PM: clock_ops: fix missing clk_prepare() return value check
clk_prepare() can fail, so check its status and if it fails, issue an error message and change the clock_entry_status to PCE_STATUS_ERROR. Signed-off-by: Aditya Pakki <[email protected]> [ rjw: Subject ] Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
parent
3b4ed2e2eb
commit
40619f7dd3
1 changed files with 9 additions and 4 deletions
|
|
@ -65,10 +65,15 @@ static void pm_clk_acquire(struct device *dev, struct pm_clock_entry *ce)
|
|||
if (IS_ERR(ce->clk)) {
|
||||
ce->status = PCE_STATUS_ERROR;
|
||||
} else {
|
||||
clk_prepare(ce->clk);
|
||||
ce->status = PCE_STATUS_ACQUIRED;
|
||||
dev_dbg(dev, "Clock %pC con_id %s managed by runtime PM.\n",
|
||||
ce->clk, ce->con_id);
|
||||
if (clk_prepare(ce->clk)) {
|
||||
ce->status = PCE_STATUS_ERROR;
|
||||
dev_err(dev, "clk_prepare() failed\n");
|
||||
} else {
|
||||
ce->status = PCE_STATUS_ACQUIRED;
|
||||
dev_dbg(dev,
|
||||
"Clock %pC con_id %s managed by runtime PM.\n",
|
||||
ce->clk, ce->con_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue