Skip to content

Commit

Permalink
Kobject: change arch/x86/kernel/cpu/mcheck/mce_amd_64.c to use kobjec…
Browse files Browse the repository at this point in the history
…t_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: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Greg Kroah-Hartman committed Jan 25, 2008
1 parent a521cf2 commit 542eb75
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions arch/x86/kernel/cpu/mcheck/mce_amd_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,9 @@ static __cpuinit int allocate_threshold_blocks(unsigned int cpu,
else
per_cpu(threshold_banks, cpu)[bank]->blocks = b;

kobject_set_name(&b->kobj, "misc%i", block);
b->kobj.parent = per_cpu(threshold_banks, cpu)[bank]->kobj;
b->kobj.ktype = &threshold_ktype;
err = kobject_register(&b->kobj);
err = kobject_init_and_add(&b->kobj, &threshold_ktype,
per_cpu(threshold_banks, cpu)[bank]->kobj,
"misc%i", block);
if (err)
goto out_free;
recurse:
Expand All @@ -451,6 +450,8 @@ static __cpuinit int allocate_threshold_blocks(unsigned int cpu,
if (err)
goto out_free;

kobject_uevent(&b->kobj, KOBJ_ADD);

return err;

out_free:
Expand Down

0 comments on commit 542eb75

Please sign in to comment.