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

Commit 41e4398a authored by Maulik Shah's avatar Maulik Shah
Browse files

cpuidle: lpm-levels: Set suspend and s2idle ops later during probe



There is a possibility of failing probe after setting suspend and
s2idle ops. Register suspend ops later during probe after which
there is no failure.

While at this, also add missing dma_free_coherent call.

Change-Id: I824f5d433623a4d7309875a61c68778f74d139f7
Signed-off-by: default avatarMaulik Shah <mkshah@codeaurora.org>
parent b490abfe
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1758,8 +1758,6 @@ static int lpm_probe(struct platform_device *pdev)
	 * core.  BUG in existing code but no known issues possibly because of
	 * how late lpm_levels gets initialized.
	 */
	suspend_set_ops(&lpm_suspend_ops);
	s2idle_set_ops(&lpm_s2idle_ops);
	for_each_possible_cpu(cpu) {
		cpu_histtimer = &per_cpu(histtimer, cpu);
		hrtimer_init(cpu_histtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
@@ -1807,11 +1805,15 @@ static int lpm_probe(struct platform_device *pdev)
		goto failed;
	}

	suspend_set_ops(&lpm_suspend_ops);
	s2idle_set_ops(&lpm_s2idle_ops);

	return 0;
failed:
	free_cluster_node(lpm_root_node);
	lpm_root_node = NULL;
	dma_free_coherent(&pdev->dev, size, lpm_debug, lpm_debug_phys);

	return ret;
}