]> git.baikalelectronics.ru Git - kernel.git/commit
cpufreq: Always remove sysfs cpuX/cpufreq link on ->remove_dev()
authorViresh Kumar <viresh.kumar@linaro.org>
Sat, 21 Nov 2015 03:36:49 +0000 (09:06 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 23 Nov 2015 21:49:42 +0000 (22:49 +0100)
commit295b8ec10b576f12e95798be6be557ee39aae824
treec2dac58bfd7504fcbf141dc62fb92d9bae04a6ec
parentb48f04118c734d6176de7def8e62b83e21551c3f
cpufreq: Always remove sysfs cpuX/cpufreq link on ->remove_dev()

Subsys interface's ->remove_dev() is called when the cpufreq driver is
unregistering or the CPU is getting physically removed. We keep removing
the cpuX/cpufreq link for all CPUs except the last one, which is a
mistake as all CPUs contain a link now.

Because of this, one CPU from each policy will still contain a link (to
an already removed policyX directory), after the cpufreq driver is
unregistered.

Fix that by removing the link first and then only see if the policy is
required to be freed. That will make sure that no links are left out.

Fixes: 6171f1aea78a ("cpufreq: create cpu/cpufreq/policyX directories")
Reported-and-tested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq.c