diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-12-19 12:23:20 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-24 23:40:30 -0500 |
commit | 542eb75a27616bdde95c8d3764e0ab703579f8b5 (patch) | |
tree | 626739659cb40b10fc4d213def12ff00bd4beec6 /arch/x86 | |
parent | a521cf209c6e7042f85b2c5b16da3ffa8004fb7b (diff) |
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: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce_amd_64.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c index 2d65311d206e..ef15f35b10ed 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c +++ b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c | |||
@@ -432,10 +432,9 @@ static __cpuinit int allocate_threshold_blocks(unsigned int cpu, | |||
432 | else | 432 | else |
433 | per_cpu(threshold_banks, cpu)[bank]->blocks = b; | 433 | per_cpu(threshold_banks, cpu)[bank]->blocks = b; |
434 | 434 | ||
435 | kobject_set_name(&b->kobj, "misc%i", block); | 435 | err = kobject_init_and_add(&b->kobj, &threshold_ktype, |
436 | b->kobj.parent = per_cpu(threshold_banks, cpu)[bank]->kobj; | 436 | per_cpu(threshold_banks, cpu)[bank]->kobj, |
437 | b->kobj.ktype = &threshold_ktype; | 437 | "misc%i", block); |
438 | err = kobject_register(&b->kobj); | ||
439 | if (err) | 438 | if (err) |
440 | goto out_free; | 439 | goto out_free; |
441 | recurse: | 440 | recurse: |
@@ -451,6 +450,8 @@ recurse: | |||
451 | if (err) | 450 | if (err) |
452 | goto out_free; | 451 | goto out_free; |
453 | 452 | ||
453 | kobject_uevent(&b->kobj, KOBJ_ADD); | ||
454 | |||
454 | return err; | 455 | return err; |
455 | 456 | ||
456 | out_free: | 457 | out_free: |