cpufreq: kryo: Release OPP tables on module removal
authorViresh Kumar <viresh.kumar@linaro.org>
Wed, 20 Feb 2019 11:11:18 +0000 (16:41 +0530)
committerViresh Kumar <viresh.kumar@linaro.org>
Thu, 28 Feb 2019 04:08:22 +0000 (09:38 +0530)
commit0334906c06967142c8805fbe88acf787f65d3d26
tree5c04a823585c29f8edb8bacfe905c9fa0afcfb57
parentd3c1e33f5c8670ca4512d17bf712ec946eab20ea
cpufreq: kryo: Release OPP tables on module removal

Commit 5ad7346b4ae2 ("cpufreq: kryo: Add module remove and exit") made
it possible to build the kryo cpufreq driver as a module, but it failed
to release all the resources, i.e. OPP tables, when the module is
unloaded.

This patch fixes it by releasing the OPP tables, by calling
dev_pm_opp_put_supported_hw() for them, from the
qcom_cpufreq_kryo_remove() routine. The array of pointers to the OPP
tables is also allocated dynamically now in qcom_cpufreq_kryo_probe(),
as the pointers will be required while releasing the resources.

Compile tested only.

Cc: 4.18+ <stable@vger.kernel.org> # v4.18+
Fixes: 5ad7346b4ae2 ("cpufreq: kryo: Add module remove and exit")
Reviewed-by: Georgi Djakov <georgi.djakov@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/qcom-cpufreq-kryo.c