aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-12-17 14:54:39 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 23:40:28 -0500
commit038c5b3e412b0b751cb4b1507506bad3c7ffefae (patch)
tree9f3be89c2646b23eebebc80420e0c886b6623866 /drivers/cpufreq
parentd6d292c451e0ffe715fff36dc3a1129868258fa3 (diff)
Kobject: change drivers/cpufreq/cpufreq.c to use kobject_init_and_add
Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Cc: Dominik Brodowski <linux@brodo.de> Cc: Ashok Raj <ashok.raj@intel.com> Cc: Jacob Shin <jacob.shin@amd.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/cpufreq.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 79581fab82d..9e102af0c07 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -828,11 +828,8 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
828 memcpy(&new_policy, policy, sizeof(struct cpufreq_policy)); 828 memcpy(&new_policy, policy, sizeof(struct cpufreq_policy));
829 829
830 /* prepare interface data */ 830 /* prepare interface data */
831 policy->kobj.parent = &sys_dev->kobj; 831 ret = kobject_init_and_add(&policy->kobj, &ktype_cpufreq, &sys_dev->kobj,
832 policy->kobj.ktype = &ktype_cpufreq; 832 "cpufreq");
833 kobject_set_name(&policy->kobj, "cpufreq");
834
835 ret = kobject_register(&policy->kobj);
836 if (ret) { 833 if (ret) {
837 unlock_policy_rwsem_write(cpu); 834 unlock_policy_rwsem_write(cpu);
838 goto err_out_driver_exit; 835 goto err_out_driver_exit;
@@ -902,6 +899,7 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
902 goto err_out_unregister; 899 goto err_out_unregister;
903 } 900 }
904 901
902 kobject_uevent(&policy->kobj, KOBJ_ADD);
905 module_put(cpufreq_driver->owner); 903 module_put(cpufreq_driver->owner);
906 dprintk("initialization complete\n"); 904 dprintk("initialization complete\n");
907 cpufreq_debug_enable_ratelimit(); 905 cpufreq_debug_enable_ratelimit();