diff options
author | Aditya Pakki <pakki001@umn.edu> | 2019-01-05 13:58:45 -0600 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2019-01-18 11:47:07 +0100 |
commit | 40619f7dd3ef05ae7861bc60d401585d316e1374 (patch) | |
tree | 4c04db826b89b69b351aea420db426f53841fe54 | |
parent | 3b4ed2e2eb5583774a1ed4aa4596a5a3c55f2567 (diff) |
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 <pakki001@umn.edu>
[ rjw: Subject ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/base/power/clock_ops.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c index 5a42ae4078c2..365ad751ce0f 100644 --- a/drivers/base/power/clock_ops.c +++ b/drivers/base/power/clock_ops.c @@ -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); + } } } |