diff options
author | Borislav Petkov <borislav.petkov@amd.com> | 2009-06-10 11:36:57 -0400 |
---|---|---|
committer | Borislav Petkov <borislav.petkov@amd.com> | 2009-06-26 07:06:41 -0400 |
commit | 37da045067b4e923190662e21029005ea53bfaa1 (patch) | |
tree | 5b2a0a36f29ed400afabb5015683649a55406b63 /drivers/edac | |
parent | 30c875cbc1836a03a1acc6c998fa8a04f29f8f73 (diff) |
amd64_edac: misc small cleanups
- cleanup debug calls
- shorten function names
- cleanup error exit paths
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/amd64_edac.c | 13 | ||||
-rw-r--r-- | drivers/edac/amd64_edac.h | 2 |
2 files changed, 8 insertions, 7 deletions
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index 8497963a61f6..858fe6037223 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c | |||
@@ -1269,7 +1269,7 @@ static int f10_early_channel_count(struct amd64_pvt *pvt) | |||
1269 | if (channels == 0) | 1269 | if (channels == 0) |
1270 | channels = 1; | 1270 | channels = 1; |
1271 | 1271 | ||
1272 | debugf0("DIMM count= %d\n", channels); | 1272 | debugf0("MCT channel count: %d\n", channels); |
1273 | 1273 | ||
1274 | return channels; | 1274 | return channels; |
1275 | 1275 | ||
@@ -3056,7 +3056,7 @@ static int amd64_probe_one_instance(struct pci_dev *dram_f2_ctl, | |||
3056 | if (!pvt) | 3056 | if (!pvt) |
3057 | goto err_exit; | 3057 | goto err_exit; |
3058 | 3058 | ||
3059 | pvt->mc_node_id = get_mc_node_id_from_pdev(dram_f2_ctl); | 3059 | pvt->mc_node_id = get_node_id(dram_f2_ctl); |
3060 | 3060 | ||
3061 | pvt->dram_f2_ctl = dram_f2_ctl; | 3061 | pvt->dram_f2_ctl = dram_f2_ctl; |
3062 | pvt->ext_model = boot_cpu_data.x86_model >> 4; | 3062 | pvt->ext_model = boot_cpu_data.x86_model >> 4; |
@@ -3183,8 +3183,7 @@ static int __devinit amd64_init_one_instance(struct pci_dev *pdev, | |||
3183 | { | 3183 | { |
3184 | int ret = 0; | 3184 | int ret = 0; |
3185 | 3185 | ||
3186 | debugf0("(MC node=%d,mc_type='%s')\n", | 3186 | debugf0("(MC node=%d,mc_type='%s')\n", get_node_id(pdev), |
3187 | get_mc_node_id_from_pdev(pdev), | ||
3188 | get_amd_family_name(mc_type->driver_data)); | 3187 | get_amd_family_name(mc_type->driver_data)); |
3189 | 3188 | ||
3190 | ret = pci_enable_device(pdev); | 3189 | ret = pci_enable_device(pdev); |
@@ -3323,15 +3322,17 @@ static int __init amd64_edac_init(void) | |||
3323 | 3322 | ||
3324 | err = amd64_init_2nd_stage(pvt_lookup[nb]); | 3323 | err = amd64_init_2nd_stage(pvt_lookup[nb]); |
3325 | if (err) | 3324 | if (err) |
3326 | goto err_exit; | 3325 | goto err_2nd_stage; |
3327 | } | 3326 | } |
3328 | 3327 | ||
3329 | amd64_setup_pci_device(); | 3328 | amd64_setup_pci_device(); |
3330 | 3329 | ||
3331 | return 0; | 3330 | return 0; |
3332 | 3331 | ||
3332 | err_2nd_stage: | ||
3333 | debugf0("2nd stage failed\n"); | ||
3334 | |||
3333 | err_exit: | 3335 | err_exit: |
3334 | debugf0("'finish_setup' stage failed\n"); | ||
3335 | pci_unregister_driver(&amd64_pci_driver); | 3336 | pci_unregister_driver(&amd64_pci_driver); |
3336 | 3337 | ||
3337 | return err; | 3338 | return err; |
diff --git a/drivers/edac/amd64_edac.h b/drivers/edac/amd64_edac.h index a159957e167b..ba73015af8e4 100644 --- a/drivers/edac/amd64_edac.h +++ b/drivers/edac/amd64_edac.h | |||
@@ -444,7 +444,7 @@ enum { | |||
444 | #define K8_MSR_MC4ADDR 0x0412 | 444 | #define K8_MSR_MC4ADDR 0x0412 |
445 | 445 | ||
446 | /* AMD sets the first MC device at device ID 0x18. */ | 446 | /* AMD sets the first MC device at device ID 0x18. */ |
447 | static inline int get_mc_node_id_from_pdev(struct pci_dev *pdev) | 447 | static inline int get_node_id(struct pci_dev *pdev) |
448 | { | 448 | { |
449 | return PCI_SLOT(pdev->devfn) - 0x18; | 449 | return PCI_SLOT(pdev->devfn) - 0x18; |
450 | } | 450 | } |