diff options
author | Borislav Petkov <borislav.petkov@amd.com> | 2010-09-22 11:44:51 -0400 |
---|---|---|
committer | Borislav Petkov <borislav.petkov@amd.com> | 2011-01-07 05:54:24 -0500 |
commit | bad11e031862294265145d87dd4be1ae4af0d57f (patch) | |
tree | ccc411f7b6543e807137ad68f6c79c7ce5b88ba7 /drivers/edac | |
parent | 1b07ca47ff2fbffbe09d8b0a0a25d8747a3cdcae (diff) |
EDAC, MCE: Enable MCE decoding on F15h
Now that everything is inplace, enable MCE decoding on F15h. Make
initcall routine a bit more readable.
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/mce_amd.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c index 0a19d2626686..59ad34c506a5 100644 --- a/drivers/edac/mce_amd.c +++ b/drivers/edac/mce_amd.c | |||
@@ -836,18 +836,21 @@ static struct notifier_block amd_mce_dec_nb = { | |||
836 | 836 | ||
837 | static int __init mce_amd_init(void) | 837 | static int __init mce_amd_init(void) |
838 | { | 838 | { |
839 | if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) | 839 | struct cpuinfo_x86 *c = &boot_cpu_data; |
840 | |||
841 | if (c->x86_vendor != X86_VENDOR_AMD) | ||
840 | return 0; | 842 | return 0; |
841 | 843 | ||
842 | if ((boot_cpu_data.x86 < 0xf || boot_cpu_data.x86 > 0x12) && | 844 | if ((c->x86 < 0xf || c->x86 > 0x12) && |
843 | (boot_cpu_data.x86 != 0x14 || boot_cpu_data.x86_model > 0xf)) | 845 | (c->x86 != 0x14 || c->x86_model > 0xf) && |
846 | (c->x86 != 0x15 || c->x86_model > 0xf)) | ||
844 | return 0; | 847 | return 0; |
845 | 848 | ||
846 | fam_ops = kzalloc(sizeof(struct amd_decoder_ops), GFP_KERNEL); | 849 | fam_ops = kzalloc(sizeof(struct amd_decoder_ops), GFP_KERNEL); |
847 | if (!fam_ops) | 850 | if (!fam_ops) |
848 | return -ENOMEM; | 851 | return -ENOMEM; |
849 | 852 | ||
850 | switch (boot_cpu_data.x86) { | 853 | switch (c->x86) { |
851 | case 0xf: | 854 | case 0xf: |
852 | fam_ops->dc_mce = k8_dc_mce; | 855 | fam_ops->dc_mce = k8_dc_mce; |
853 | fam_ops->ic_mce = k8_ic_mce; | 856 | fam_ops->ic_mce = k8_ic_mce; |
@@ -887,8 +890,7 @@ static int __init mce_amd_init(void) | |||
887 | break; | 890 | break; |
888 | 891 | ||
889 | default: | 892 | default: |
890 | printk(KERN_WARNING "Huh? What family is that: %d?!\n", | 893 | printk(KERN_WARNING "Huh? What family is that: %d?!\n", c->x86); |
891 | boot_cpu_data.x86); | ||
892 | kfree(fam_ops); | 894 | kfree(fam_ops); |
893 | return -EINVAL; | 895 | return -EINVAL; |
894 | } | 896 | } |