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

Commit 2791c02a authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "cpufreq: qcom: Add code to support module removal"

parents c28e3da0 af287a04
Loading
Loading
Loading
Loading
+21 −2
Original line number Diff line number Diff line
@@ -528,14 +528,14 @@ static int qcom_resources_init(struct platform_device *pdev)
	unsigned int cpu;
	int ret;

	clk = devm_clk_get(&pdev->dev, "xo");
	clk = clk_get(&pdev->dev, "xo");
	if (IS_ERR(clk))
		return PTR_ERR(clk);

	xo_rate = clk_get_rate(clk);
	clk_put(clk);

	clk = devm_clk_get(&pdev->dev, "alternate");
	clk = clk_get(&pdev->dev, "alternate");
	if (IS_ERR(clk))
		return PTR_ERR(clk);

@@ -612,6 +612,25 @@ static int qcom_cpufreq_hw_driver_probe(struct platform_device *pdev)

static int qcom_cpufreq_hw_driver_remove(struct platform_device *pdev)
{
	struct cpufreq_qcom *c;
	struct device *cpu_dev;
	int cpu;

	for_each_possible_cpu(cpu) {
		cpu_dev = get_cpu_device(cpu);
		if (!cpu_dev)
			continue;

		dev_pm_opp_remove_all_dynamic(cpu_dev);

		c = qcom_freq_domain_map[cpu];
		if (c->dcvsh_irq > 0 && c->is_irq_requested) {
			devm_free_irq(cpu_dev, c->dcvsh_irq, c);
			device_remove_file(cpu_dev, &c->freq_limit_attr);
			c->is_irq_requested = false;
		}
	}

	return cpufreq_unregister_driver(&cpufreq_qcom_hw_driver);
}