aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-01-25 11:34:42 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-01-25 11:35:13 -0500
commitdf8dc74e8a383eaf2d9b44b80a71ec6f0e52b42e (patch)
treebc3799a43e8b94fa84b32e37b1c124d5e4868f50 /drivers/cpufreq/cpufreq.c
parent556a169dab38b5100df6f4a45b655dddd3db94c1 (diff)
parent4a3ad20ccd8f4d2a0535cf98fa83f7b561ba59a9 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6
This can be broken down into these major areas: - Documentation updates (language translations and fixes, as well as kobject and kset documenatation updates.) - major kset/kobject/ktype rework and fixes. This cleans up the kset and kobject and ktype relationship and architecture, making sense of things now, and good documenation and samples are provided for others to use. Also the attributes for kobjects are much easier to handle now. This cleaned up a LOT of code all through the kernel, making kobjects easier to use if you want to. - struct bus_type has been reworked to now handle the lifetime rules properly, as the kobject is properly dynamic. - struct driver has also been reworked, and now the lifetime issues are resolved. - the block subsystem has been converted to use struct device now, and not "raw" kobjects. This patch has been in the -mm tree for over a year now, and finally all the issues are worked out with it. Older distros now properly work with new kernels, and no userspace updates are needed at all. - nozomi driver is added. This has also been in -mm for a long time, and many people have asked for it to go in. It is now in good enough shape to do so. - lots of class_device conversions to use struct device instead. The tree is almost all cleaned up now, only SCSI and IB is the remaining code to fix up... * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6: (196 commits) Driver core: coding style fixes Kobject: fix coding style issues in kobject c files Kobject: fix coding style issues in kobject.h Driver core: fix coding style issues in device.h spi: use class iteration api scsi: use class iteration api rtc: use class iteration api power supply : use class iteration api ieee1394: use class iteration api Driver Core: add class iteration api Driver core: Cleanup get_device_parent() in device_add() and device_move() UIO: constify function pointer tables Driver Core: constify the name passed to platform_device_register_simple driver core: fix build with SYSFS=n sysfs: make SYSFS_DEPRECATED depend on SYSFS Driver core: use LIST_HEAD instead of call to INIT_LIST_HEAD in __init kobject: add sample code for how to use ksets/ktypes/kobjects kobject: add sample code for how to use kobjects in a simple manner. kobject: update the kobject/kset documentation kobject: remove old, outdated documentation. ...
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r--drivers/cpufreq/cpufreq.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 79581fab82d6..5efd5550f4ca 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();
@@ -915,7 +913,7 @@ err_out_unregister:
915 cpufreq_cpu_data[j] = NULL; 913 cpufreq_cpu_data[j] = NULL;
916 spin_unlock_irqrestore(&cpufreq_driver_lock, flags); 914 spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
917 915
918 kobject_unregister(&policy->kobj); 916 kobject_put(&policy->kobj);
919 wait_for_completion(&policy->kobj_unregister); 917 wait_for_completion(&policy->kobj_unregister);
920 918
921err_out_driver_exit: 919err_out_driver_exit:
@@ -1032,8 +1030,6 @@ static int __cpufreq_remove_dev (struct sys_device * sys_dev)
1032 1030
1033 unlock_policy_rwsem_write(cpu); 1031 unlock_policy_rwsem_write(cpu);
1034 1032
1035 kobject_unregister(&data->kobj);
1036
1037 kobject_put(&data->kobj); 1033 kobject_put(&data->kobj);
1038 1034
1039 /* we need to make sure that the underlying kobj is actually 1035 /* we need to make sure that the underlying kobj is actually