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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Mar 2019 19:10:01 +0000 (20:10 +0100)
commit33565a76a7b23ad7b28709bfa8841debb421de61
tree9e45b89cc9cddf3e7dbe1b7b30138c82304fdf6b
parentee7d297fba245621060952d3575dbc7303d0873a
cpufreq: kryo: Release OPP tables on module removal

commit 0334906c06967142c8805fbe88acf787f65d3d26 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/cpufreq/qcom-cpufreq-kryo.c