aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/base/power/clock_ops.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
index b99e6c06ee67..78369305e069 100644
--- a/drivers/base/power/clock_ops.c
+++ b/drivers/base/power/clock_ops.c
@@ -368,8 +368,13 @@ int pm_clk_suspend(struct device *dev)
368 368
369 spin_lock_irqsave(&psd->lock, flags); 369 spin_lock_irqsave(&psd->lock, flags);
370 370
371 list_for_each_entry_reverse(ce, &psd->clock_list, node) 371 list_for_each_entry_reverse(ce, &psd->clock_list, node) {
372 clk_disable(ce->clk); 372 if (ce->status < PCE_STATUS_ERROR) {
373 if (ce->status == PCE_STATUS_ENABLED)
374 clk_disable(ce->clk);
375 ce->status = PCE_STATUS_ACQUIRED;
376 }
377 }
373 378
374 spin_unlock_irqrestore(&psd->lock, flags); 379 spin_unlock_irqrestore(&psd->lock, flags);
375 380
@@ -385,6 +390,7 @@ int pm_clk_resume(struct device *dev)
385 struct pm_subsys_data *psd = dev_to_psd(dev); 390 struct pm_subsys_data *psd = dev_to_psd(dev);
386 struct pm_clock_entry *ce; 391 struct pm_clock_entry *ce;
387 unsigned long flags; 392 unsigned long flags;
393 int ret;
388 394
389 dev_dbg(dev, "%s()\n", __func__); 395 dev_dbg(dev, "%s()\n", __func__);
390 396
@@ -394,8 +400,13 @@ int pm_clk_resume(struct device *dev)
394 400
395 spin_lock_irqsave(&psd->lock, flags); 401 spin_lock_irqsave(&psd->lock, flags);
396 402
397 list_for_each_entry(ce, &psd->clock_list, node) 403 list_for_each_entry(ce, &psd->clock_list, node) {
398 __pm_clk_enable(dev, ce->clk); 404 if (ce->status < PCE_STATUS_ERROR) {
405 ret = __pm_clk_enable(dev, ce->clk);
406 if (!ret)
407 ce->status = PCE_STATUS_ENABLED;
408 }
409 }
399 410
400 spin_unlock_irqrestore(&psd->lock, flags); 411 spin_unlock_irqrestore(&psd->lock, flags);
401 412