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>
This commit is contained in:
@@ -354,17 +354,16 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
|
|||||||
if (unlikely(retval < 0))
|
if (unlikely(retval < 0))
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
all_cpu_cache_info[cpu].kobj.parent = &sys_dev->kobj;
|
retval = kobject_init_and_add(&all_cpu_cache_info[cpu].kobj,
|
||||||
kobject_set_name(&all_cpu_cache_info[cpu].kobj, "%s", "cache");
|
&cache_ktype_percpu_entry, &sys_dev->kobj,
|
||||||
all_cpu_cache_info[cpu].kobj.ktype = &cache_ktype_percpu_entry;
|
"%s", "cache");
|
||||||
retval = kobject_register(&all_cpu_cache_info[cpu].kobj);
|
|
||||||
|
|
||||||
for (i = 0; i < all_cpu_cache_info[cpu].num_cache_leaves; i++) {
|
for (i = 0; i < all_cpu_cache_info[cpu].num_cache_leaves; i++) {
|
||||||
this_object = LEAF_KOBJECT_PTR(cpu,i);
|
this_object = LEAF_KOBJECT_PTR(cpu,i);
|
||||||
this_object->kobj.parent = &all_cpu_cache_info[cpu].kobj;
|
retval = kobject_init_and_add(&(this_object->kobj),
|
||||||
kobject_set_name(&(this_object->kobj), "index%1lu", i);
|
&cache_ktype,
|
||||||
this_object->kobj.ktype = &cache_ktype;
|
&all_cpu_cache_info[cpu].kobj,
|
||||||
retval = kobject_register(&(this_object->kobj));
|
"index%1lu", i);
|
||||||
if (unlikely(retval)) {
|
if (unlikely(retval)) {
|
||||||
for (j = 0; j < i; j++) {
|
for (j = 0; j < i; j++) {
|
||||||
kobject_unregister(
|
kobject_unregister(
|
||||||
@@ -374,7 +373,9 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
|
|||||||
cpu_cache_sysfs_exit(cpu);
|
cpu_cache_sysfs_exit(cpu);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
kobject_uevent(&(this_object->kobj), KOBJ_ADD);
|
||||||
}
|
}
|
||||||
|
kobject_uevent(&all_cpu_cache_info[cpu].kobj, KOBJ_ADD);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user