cpufreq: cpufreq_register_driver() should return -ENODEV if init fails
authorDavid Arcari <darcari@redhat.com>
Fri, 26 May 2017 15:37:31 +0000 (11:37 -0400)
committerSasha Levin <alexander.levin@verizon.com>
Thu, 8 Jun 2017 10:42:00 +0000 (06:42 -0400)
commit5df474e63ca56a79c41fce7530882b6ff30eed37
tree052f0fd2360d2cc68eb4a39fbc7ad3c7baf31940
parent7e144ca4d77a8866a7b39b1c573230e69488b84b
cpufreq: cpufreq_register_driver() should return -ENODEV if init fails

[ Upstream commit 6c77003677d5f1ce15f26d24360cb66c0bc07bb3 ]

For a driver that does not set the CPUFREQ_STICKY flag, if all of the
->init() calls fail, cpufreq_register_driver() should return an error.
This will prevent the driver from loading.

Fixes: ce1bcfe94db8 (cpufreq: check cpufreq_policy_list instead of scanning policies for all CPUs)
Cc: 4.0+ <stable@vger.kernel.org> # 4.0+
Signed-off-by: David Arcari <darcari@redhat.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
drivers/cpufreq/cpufreq.c