aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/edac/mce_amd.c14
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
837static int __init mce_amd_init(void) 837static 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 }