Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f1a0532 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branch 'pm-clk'

* pm-clk:
  PM / clk: Fix crash in clocks management code if !CONFIG_PM_RUNTIME
parents c9671d17 a968bed7
Loading
Loading
Loading
Loading
+15 −4
Original line number Diff line number Diff line
@@ -368,8 +368,13 @@ int pm_clk_suspend(struct device *dev)

	spin_lock_irqsave(&psd->lock, flags);

	list_for_each_entry_reverse(ce, &psd->clock_list, node)
	list_for_each_entry_reverse(ce, &psd->clock_list, node) {
		if (ce->status < PCE_STATUS_ERROR) {
			if (ce->status == PCE_STATUS_ENABLED)
				clk_disable(ce->clk);
			ce->status = PCE_STATUS_ACQUIRED;
		}
	}

	spin_unlock_irqrestore(&psd->lock, flags);

@@ -385,6 +390,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__);

@@ -394,8 +400,13 @@ int pm_clk_resume(struct device *dev)

	spin_lock_irqsave(&psd->lock, flags);

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

	spin_unlock_irqrestore(&psd->lock, flags);