diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-12-17 14:54:39 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-24 23:40:29 -0500 |
commit | c199790a8bc90c91b88ad1205dee2955401cff81 (patch) | |
tree | 16194414f5f9bf187df27e1e5fbd62f104ccba3f /arch/ia64/kernel/topology.c | |
parent | 73f368cf679babef42e54f0fe19270040ac9d4d7 (diff) |
Kobject: change arch/ia64/kernel/topology.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: Tony Luck <tony.luck@intel.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/ia64/kernel/topology.c')
-rw-r--r-- | arch/ia64/kernel/topology.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c index 14261fee5f4d..c4311e3adf55 100644 --- a/arch/ia64/kernel/topology.c +++ b/arch/ia64/kernel/topology.c | |||
@@ -354,17 +354,16 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev) | |||
354 | if (unlikely(retval < 0)) | 354 | if (unlikely(retval < 0)) |
355 | return retval; | 355 | return retval; |
356 | 356 | ||
357 | all_cpu_cache_info[cpu].kobj.parent = &sys_dev->kobj; | 357 | retval = kobject_init_and_add(&all_cpu_cache_info[cpu].kobj, |
358 | kobject_set_name(&all_cpu_cache_info[cpu].kobj, "%s", "cache"); | 358 | &cache_ktype_percpu_entry, &sys_dev->kobj, |
359 | all_cpu_cache_info[cpu].kobj.ktype = &cache_ktype_percpu_entry; | 359 | "%s", "cache"); |
360 | retval = kobject_register(&all_cpu_cache_info[cpu].kobj); | ||
361 | 360 | ||
362 | for (i = 0; i < all_cpu_cache_info[cpu].num_cache_leaves; i++) { | 361 | for (i = 0; i < all_cpu_cache_info[cpu].num_cache_leaves; i++) { |
363 | this_object = LEAF_KOBJECT_PTR(cpu,i); | 362 | this_object = LEAF_KOBJECT_PTR(cpu,i); |
364 | this_object->kobj.parent = &all_cpu_cache_info[cpu].kobj; | 363 | retval = kobject_init_and_add(&(this_object->kobj), |
365 | kobject_set_name(&(this_object->kobj), "index%1lu", i); | 364 | &cache_ktype, |
366 | this_object->kobj.ktype = &cache_ktype; | 365 | &all_cpu_cache_info[cpu].kobj, |
367 | retval = kobject_register(&(this_object->kobj)); | 366 | "index%1lu", i); |
368 | if (unlikely(retval)) { | 367 | if (unlikely(retval)) { |
369 | for (j = 0; j < i; j++) { | 368 | for (j = 0; j < i; j++) { |
370 | kobject_unregister( | 369 | kobject_unregister( |
@@ -374,7 +373,9 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev) | |||
374 | cpu_cache_sysfs_exit(cpu); | 373 | cpu_cache_sysfs_exit(cpu); |
375 | break; | 374 | break; |
376 | } | 375 | } |
376 | kobject_uevent(&(this_object->kobj), KOBJ_ADD); | ||
377 | } | 377 | } |
378 | kobject_uevent(&all_cpu_cache_info[cpu].kobj, KOBJ_ADD); | ||
378 | return retval; | 379 | return retval; |
379 | } | 380 | } |
380 | 381 | ||