aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/r82600_edac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/edac/r82600_edac.c')
-rw-r--r--drivers/edac/r82600_edac.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/edac/r82600_edac.c b/drivers/edac/r82600_edac.c
index 2c29fafe67c7..d04769aade5d 100644
--- a/drivers/edac/r82600_edac.c
+++ b/drivers/edac/r82600_edac.c
@@ -23,6 +23,8 @@
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include "edac_mc.h" 24#include "edac_mc.h"
25 25
26#define R82600_REVISION " Ver: 2.0.0 " __DATE__
27
26#define r82600_printk(level, fmt, arg...) \ 28#define r82600_printk(level, fmt, arg...) \
27 edac_printk(level, "r82600", fmt, ##arg) 29 edac_printk(level, "r82600", fmt, ##arg)
28 30
@@ -134,17 +136,20 @@ static unsigned int disable_hardware_scrub = 0;
134static void r82600_get_error_info (struct mem_ctl_info *mci, 136static void r82600_get_error_info (struct mem_ctl_info *mci,
135 struct r82600_error_info *info) 137 struct r82600_error_info *info)
136{ 138{
137 pci_read_config_dword(mci->pdev, R82600_EAP, &info->eapr); 139 struct pci_dev *pdev;
140
141 pdev = to_pci_dev(mci->dev);
142 pci_read_config_dword(pdev, R82600_EAP, &info->eapr);
138 143
139 if (info->eapr & BIT(0)) 144 if (info->eapr & BIT(0))
140 /* Clear error to allow next error to be reported [p.62] */ 145 /* Clear error to allow next error to be reported [p.62] */
141 pci_write_bits32(mci->pdev, R82600_EAP, 146 pci_write_bits32(pdev, R82600_EAP,
142 ((u32) BIT(0) & (u32) BIT(1)), 147 ((u32) BIT(0) & (u32) BIT(1)),
143 ((u32) BIT(0) & (u32) BIT(1))); 148 ((u32) BIT(0) & (u32) BIT(1)));
144 149
145 if (info->eapr & BIT(1)) 150 if (info->eapr & BIT(1))
146 /* Clear error to allow next error to be reported [p.62] */ 151 /* Clear error to allow next error to be reported [p.62] */
147 pci_write_bits32(mci->pdev, R82600_EAP, 152 pci_write_bits32(pdev, R82600_EAP,
148 ((u32) BIT(0) & (u32) BIT(1)), 153 ((u32) BIT(0) & (u32) BIT(1)),
149 ((u32) BIT(0) & (u32) BIT(1))); 154 ((u32) BIT(0) & (u32) BIT(1)));
150} 155}
@@ -232,7 +237,7 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
232 } 237 }
233 238
234 debugf0("%s(): mci = %p\n", __func__, mci); 239 debugf0("%s(): mci = %p\n", __func__, mci);
235 mci->pdev = pdev; 240 mci->dev = &pdev->dev;
236 mci->mtype_cap = MEM_FLAG_RDDR | MEM_FLAG_DDR; 241 mci->mtype_cap = MEM_FLAG_RDDR | MEM_FLAG_DDR;
237 mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_EC | EDAC_FLAG_SECDED; 242 mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_EC | EDAC_FLAG_SECDED;
238 /* FIXME try to work out if the chip leads have been used for COM2 243 /* FIXME try to work out if the chip leads have been used for COM2
@@ -253,7 +258,7 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
253 mci->edac_cap = EDAC_FLAG_NONE; 258 mci->edac_cap = EDAC_FLAG_NONE;
254 259
255 mci->mod_name = EDAC_MOD_STR; 260 mci->mod_name = EDAC_MOD_STR;
256 mci->mod_ver = "$Revision: 1.1.2.6 $"; 261 mci->mod_ver = R82600_REVISION;
257 mci->ctl_name = "R82600"; 262 mci->ctl_name = "R82600";
258 mci->edac_check = r82600_check; 263 mci->edac_check = r82600_check;
259 mci->ctl_page_to_phys = NULL; 264 mci->ctl_page_to_phys = NULL;
@@ -265,7 +270,7 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
265 u32 row_base; 270 u32 row_base;
266 271
267 /* find the DRAM Chip Select Base address and mask */ 272 /* find the DRAM Chip Select Base address and mask */
268 pci_read_config_byte(mci->pdev, R82600_DRBA + index, &drbar); 273 pci_read_config_byte(pdev, R82600_DRBA + index, &drbar);
269 274
270 debugf1("MC%d: %s() Row=%d DRBA = %#0x\n", mci->mc_idx, 275 debugf1("MC%d: %s() Row=%d DRBA = %#0x\n", mci->mc_idx,
271 __func__, index, drbar); 276 __func__, index, drbar);
@@ -309,7 +314,7 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
309 if (disable_hardware_scrub) { 314 if (disable_hardware_scrub) {
310 debugf3("%s(): Disabling Hardware Scrub (scrub on error)\n", 315 debugf3("%s(): Disabling Hardware Scrub (scrub on error)\n",
311 __func__); 316 __func__);
312 pci_write_bits32(mci->pdev, R82600_EAP, BIT(31), BIT(31)); 317 pci_write_bits32(pdev, R82600_EAP, BIT(31), BIT(31));
313 } 318 }
314 319
315 debugf3("%s(): success\n", __func__); 320 debugf3("%s(): success\n", __func__);
@@ -338,7 +343,7 @@ static void __devexit r82600_remove_one(struct pci_dev *pdev)
338 343
339 debugf0("%s()\n", __func__); 344 debugf0("%s()\n", __func__);
340 345
341 if ((mci = edac_mc_del_mc(pdev)) == NULL) 346 if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL)
342 return; 347 return;
343 348
344 edac_mc_free(mci); 349 edac_mc_free(mci);