cpufreq: cpufreq_register_driver should return -ENODEV if init fails
Subsystems (2)
PATCH 1/1 cpufreq: cpufreq_register_driver should return -ENODEV if init fails
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.
--- drivers/cpufreq/cpufreq.c | 1 + 1 file changed, 1 insertion(+)
drivers/cpufreq/cpufreq.c +1 -0
@@ -2468,6 +2468,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)if (!(cpufreq_driver->flags &CPUFREQ_STICKY ) &&list_empty (&cpufreq_policy_list)) {/* if all ->init() calls failed, unregister */ + ret = -ENODEV ;pr_debug ("%s: No CPU initialized for driver %s\n" , __func__, driver_data->name); goto err_if_unreg;
Signature · 1 line
1.8.3.1
You sent it to the wrong list and missed Rafael too. MAINTAINERS file should help getting these details in the future.
Quoted 8 lines · David Arcari
For a driver that does not set the
CPUFREQ_STICKYflag, 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 Viresh Kumar <[email protected]>Signed-off-by David Arcari <[email protected]>
+
Cc: 4.0+ <[email protected]> # 4.0+
Quoted 9 lines
--- drivers/cpufreq/cpufreq.c | 1 + 1 file changed, 1 insertion(+)drivers/cpufreq/cpufreq.c +0
-0
drivers/cpufreq/cpufreq.c int cpufreq_register_driver(struct cpufreq_driver *driver_data) · line 2474
Quoted 7 lines
drivers/cpufreq/cpufreq.c +1
-0@@ -2468,6 +2468,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)if (!(cpufreq_driver->flags &CPUFREQ_STICKY ) &&list_empty (&cpufreq_policy_list)) {/* if all ->init() calls failed, unregister */ + ret = -ENODEV ;pr_debug ("%s: No CPU initialized for driver %s\n" , __func__, driver_data->name); goto err_if_unreg;
Signature · 1 line
viresh
Quoted 2 lines · Viresh Kumar
You sent it to the wrong list and missed Rafael too.
MAINTAINERSfile should help getting these details in the future.
Oops - my bad.
Rafael - is this OK as is or would you prefer I resend this?
Thanks,
-DA
Quoted 33 lines · David Arcari
Quoted 8 lines
For a driver that does not set the
CPUFREQ_STICKYflag, 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 Viresh Kumar <[email protected]>Signed-off-by David Arcari <[email protected]>+
Cc: 4.0+ <[email protected]> # 4.0+Quoted 9 lines
--- drivers/cpufreq/cpufreq.c | 1 + 1 file changed, 1 insertion(+)drivers/cpufreq/cpufreq.c +0
-0drivers/cpufreq/cpufreq.c int cpufreq_register_driver(struct cpufreq_driver *driver_data) · line 2474
Quoted 7 lines
drivers/cpufreq/cpufreq.c +1
-0@@ -2468,6 +2468,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)if (!(cpufreq_driver->flags &CPUFREQ_STICKY ) &&list_empty (&cpufreq_policy_list)) {/* if all ->init() calls failed, unregister */ + ret = -ENODEV ;pr_debug ("%s: No CPU initialized for driver %s\n" , __func__, driver_data->name); goto err_if_unreg;Acked-by Viresh Kumar <[email protected]>
Quoted 7 lines · David Arcari
Quoted 2 lines · Viresh Kumar
You sent it to the wrong list and missed Rafael too.
MAINTAINERSfile should help getting these details in the future.Oops - my bad.
Rafael - is this OK as is or would you prefer I resend this?
No need to resend, thanks!
I've actually queued it up already.
Thanks,
Rafael