Commit 542eb75a authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Kobject: change arch/x86/kernel/cpu/mcheck/mce_amd_64.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: Jacob Shin <jacob.shin@amd.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a521cf20
...@@ -432,10 +432,9 @@ static __cpuinit int allocate_threshold_blocks(unsigned int cpu, ...@@ -432,10 +432,9 @@ static __cpuinit int allocate_threshold_blocks(unsigned int cpu,
else else
per_cpu(threshold_banks, cpu)[bank]->blocks = b; per_cpu(threshold_banks, cpu)[bank]->blocks = b;
kobject_set_name(&b->kobj, "misc%i", block); err = kobject_init_and_add(&b->kobj, &threshold_ktype,
b->kobj.parent = per_cpu(threshold_banks, cpu)[bank]->kobj; per_cpu(threshold_banks, cpu)[bank]->kobj,
b->kobj.ktype = &threshold_ktype; "misc%i", block);
err = kobject_register(&b->kobj);
if (err) if (err)
goto out_free; goto out_free;
recurse: recurse:
...@@ -451,6 +450,8 @@ static __cpuinit int allocate_threshold_blocks(unsigned int cpu, ...@@ -451,6 +450,8 @@ static __cpuinit int allocate_threshold_blocks(unsigned int cpu,
if (err) if (err)
goto out_free; goto out_free;
kobject_uevent(&b->kobj, KOBJ_ADD);
return err; return err;
out_free: out_free:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment