diff options
Diffstat (limited to 'arch/ia64/kernel')
-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 | ||