mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
x86/cpufreq: relocate the driver register function
Move the driver register function to the cpufreq.c, and remove the (unused) de-registration one. Signed-off-by: Wei Wang <wei.w.wang@intel.com> Mark the funciton __init. Signed-off-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
1b92b94c58
commit
49388f11d5
2 files changed
+16
-26
No files matched your search
@@ -638,3 +638,18 @@ static int __init cpufreq_presmp_init(void)
|
||||
}
|
||||
presmp_initcall(cpufreq_presmp_init);
|
||||
|
||||
int __init cpufreq_register_driver(struct cpufreq_driver *driver_data)
|
||||
{
|
||||
if ( !driver_data || !driver_data->init ||
|
||||
!driver_data->verify || !driver_data->exit ||
|
||||
(!driver_data->target == !driver_data->setpolicy) )
|
||||
return -EINVAL;
|
||||
|
||||
if ( cpufreq_driver )
|
||||
return -EBUSY;
|
||||
|
||||
cpufreq_driver = driver_data;
|
||||
|
||||
register_cpu_notifier(&cpu_nfb);
|
||||
return 0;
|
||||
}
|
||||
@@ -170,32 +170,7 @@ struct cpufreq_driver {
|
||||
|
||||
extern struct cpufreq_driver *cpufreq_driver;
|
||||
|
||||
static __inline__
|
||||
int cpufreq_register_driver(struct cpufreq_driver *driver_data)
|
||||
{
|
||||
if (!driver_data ||
|
||||
!driver_data->init ||
|
||||
!driver_data->exit ||
|
||||
!driver_data->verify ||
|
||||
!driver_data->target)
|
||||
return -EINVAL;
|
||||
|
||||
if (cpufreq_driver)
|
||||
return -EBUSY;
|
||||
|
||||
cpufreq_driver = driver_data;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static __inline__
|
||||
int cpufreq_unregister_driver(struct cpufreq_driver *driver)
|
||||
{
|
||||
if (!cpufreq_driver || (driver != cpufreq_driver))
|
||||
return -EINVAL;
|
||||
|
||||
cpufreq_driver = NULL;
|
||||
return 0;
|
||||
}
|
||||
int cpufreq_register_driver(struct cpufreq_driver *);
|
||||
|
||||
static __inline__
|
||||
void cpufreq_verify_within_limits(struct cpufreq_policy *policy,
|
||||
|
||||