Skip to content

Commit

Permalink
PM / clock_ops: check return of clk_enable() in pm_clk_resume()
Browse files Browse the repository at this point in the history
The clk_enable() call in the pm_clk_resume() call returns an error
that is not being checked. If clk_enable() fails then we should
not set the state of the clock to PCE_STATUS_ENABLED.

Note, the issue of warning the user if this fails has not been
addressed in this patch as this is not the only place the driver
calls clk_enable().

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Reviewed-by: Ian Molton <ian.molton@codethink.co.uk>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Ben Dooks authored and Rafael J. Wysocki committed Jan 15, 2014
1 parent 8a6720e commit afdd3ab
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/base/power/clock_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ int pm_clk_resume(struct device *dev)
struct pm_subsys_data *psd = dev_to_psd(dev);
struct pm_clock_entry *ce;
unsigned long flags;
int ret;

dev_dbg(dev, "%s()\n", __func__);

Expand All @@ -262,8 +263,9 @@ int pm_clk_resume(struct device *dev)

list_for_each_entry(ce, &psd->clock_list, node) {
if (ce->status < PCE_STATUS_ERROR) {
clk_enable(ce->clk);
ce->status = PCE_STATUS_ENABLED;
ret = clk_enable(ce->clk);
if (!ret)
ce->status = PCE_STATUS_ENABLED;
}
}

Expand Down

0 comments on commit afdd3ab

Please sign in to comment.