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

This commit is contained in:
qctecmdr 2020-06-17 02:00:28 -07:00 • committed by Gerrit - the friendly Code Review server
commit 2791c02ab1

View file

@ -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);
}