OSDN Git Service

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)
committerViresh Kumar <viresh.kumar@linaro.org>
Fri, 6 May 2022 04:08:10 +0000 (09:38 +0530)
commitf126fbadce92b92c3a7be41e4abc1fbae93ae2ef
tree228b93973a5b2a964a53f048d95e0128026f6bd0
parenta3b8d1b12c6bc3655332f19af84d0780ba88a578
cpufreq: mediatek: Unregister platform device on exit

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>
drivers/cpufreq/mediatek-cpufreq.c