cpufreq: mediatek: Unregister platform device on exit
authorRex-BC Chen <rex-bc.chen@mediatek.com>
Thu, 5 May 2022 11:52:18 +0000 (19:52 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:23:14 +0000 (10:23 +0200)
commit2f124280f0aed93b6fadc64ccb51c670f088150d
tree9b23aea2ff48fd13c6c4f018916ce3101592d77f
parent4477a67d0b568d8f8ab8f1e112d1e4dc4f97c053
cpufreq: mediatek: Unregister platform device on exit

[ Upstream commit f126fbadce92b92c3a7be41e4abc1fbae93ae2ef ]

We register the platform device when driver inits. However, we do not
unregister it when driver exits.

To resolve this, we declare the platform data to be a global static
variable and rename it to be "cpufreq_pdev". With this global variable,
we can do platform_device_unregister() when driver exits.

Fixes: 501c574f4e3a ("cpufreq: mediatek: Add support of cpufreq to MT2701/MT7623 SoC")
Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
[ Viresh: Commit log and Subject ]
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/cpufreq/mediatek-cpufreq.c