aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/i82875p_edac.c
diff options
context:
space:
mode:
authorDoug Thompson <norsk5@xmission.com>2006-06-30 04:56:07 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-30 14:25:39 -0400
commit37f04581abac20444e5b7106c1e1f28bec5b989c (patch)
tree4112a057284749c5d53c6b9a8bf9f5e6c4ba34ef /drivers/edac/i82875p_edac.c
parentdc474c891c1993c4d608bed00c425b6db93d088d (diff)
[PATCH] EDAC: PCI device to DEVICE cleanup
Change MC drivers from using CVS revision strings for their version number, Now each driver has its own local string. Remove some PCI dependencies from the core EDAC module. Made the code 'struct device' centric instead of 'struct pci_dev' Most of the code changes here are from a patch by Dave Jiang. It may be best to eventually move the PCI-specific code into a separate source file. Signed-off-by: Doug Thompson <norsk5@xmission.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/edac/i82875p_edac.c')
-rw-r--r--drivers/edac/i82875p_edac.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/drivers/edac/i82875p_edac.c b/drivers/edac/i82875p_edac.c
index 0aec92698f1..3f509a7ea02 100644
--- a/drivers/edac/i82875p_edac.c
+++ b/drivers/edac/i82875p_edac.c
@@ -21,6 +21,8 @@
21#include <linux/slab.h> 21#include <linux/slab.h>
22#include "edac_mc.h" 22#include "edac_mc.h"
23 23
24#define I82875P_REVISION " Ver: 2.0.0 " __DATE__
25
24#define i82875p_printk(level, fmt, arg...) \ 26#define i82875p_printk(level, fmt, arg...) \
25 edac_printk(level, "i82875p", fmt, ##arg) 27 edac_printk(level, "i82875p", fmt, ##arg)
26 28
@@ -185,18 +187,22 @@ static int i82875p_registered = 1;
185static void i82875p_get_error_info(struct mem_ctl_info *mci, 187static void i82875p_get_error_info(struct mem_ctl_info *mci,
186 struct i82875p_error_info *info) 188 struct i82875p_error_info *info)
187{ 189{
190 struct pci_dev *pdev;
191
192 pdev = to_pci_dev(mci->dev);
193
188 /* 194 /*
189 * This is a mess because there is no atomic way to read all the 195 * This is a mess because there is no atomic way to read all the
190 * registers at once and the registers can transition from CE being 196 * registers at once and the registers can transition from CE being
191 * overwritten by UE. 197 * overwritten by UE.
192 */ 198 */
193 pci_read_config_word(mci->pdev, I82875P_ERRSTS, &info->errsts); 199 pci_read_config_word(pdev, I82875P_ERRSTS, &info->errsts);
194 pci_read_config_dword(mci->pdev, I82875P_EAP, &info->eap); 200 pci_read_config_dword(pdev, I82875P_EAP, &info->eap);
195 pci_read_config_byte(mci->pdev, I82875P_DES, &info->des); 201 pci_read_config_byte(pdev, I82875P_DES, &info->des);
196 pci_read_config_byte(mci->pdev, I82875P_DERRSYN, &info->derrsyn); 202 pci_read_config_byte(pdev, I82875P_DERRSYN, &info->derrsyn);
197 pci_read_config_word(mci->pdev, I82875P_ERRSTS, &info->errsts2); 203 pci_read_config_word(pdev, I82875P_ERRSTS, &info->errsts2);
198 204
199 pci_write_bits16(mci->pdev, I82875P_ERRSTS, 0x0081, 0x0081); 205 pci_write_bits16(pdev, I82875P_ERRSTS, 0x0081, 0x0081);
200 206
201 /* 207 /*
202 * If the error is the same then we can for both reads then 208 * If the error is the same then we can for both reads then
@@ -208,9 +214,9 @@ static void i82875p_get_error_info(struct mem_ctl_info *mci,
208 return; 214 return;
209 215
210 if ((info->errsts ^ info->errsts2) & 0x0081) { 216 if ((info->errsts ^ info->errsts2) & 0x0081) {
211 pci_read_config_dword(mci->pdev, I82875P_EAP, &info->eap); 217 pci_read_config_dword(pdev, I82875P_EAP, &info->eap);
212 pci_read_config_byte(mci->pdev, I82875P_DES, &info->des); 218 pci_read_config_byte(pdev, I82875P_DES, &info->des);
213 pci_read_config_byte(mci->pdev, I82875P_DERRSYN, 219 pci_read_config_byte(pdev, I82875P_DERRSYN,
214 &info->derrsyn); 220 &info->derrsyn);
215 } 221 }
216} 222}
@@ -337,14 +343,14 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
337 } 343 }
338 344
339 debugf3("%s(): init mci\n", __func__); 345 debugf3("%s(): init mci\n", __func__);
340 mci->pdev = pdev; 346 mci->dev = &pdev->dev;
341 mci->mtype_cap = MEM_FLAG_DDR; 347 mci->mtype_cap = MEM_FLAG_DDR;
342 mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED; 348 mci->edac_ctl_cap = EDAC_FLAG_NONE | EDAC_FLAG_SECDED;
343 mci->edac_cap = EDAC_FLAG_UNKNOWN; 349 mci->edac_cap = EDAC_FLAG_UNKNOWN;
344 /* adjust FLAGS */ 350 /* adjust FLAGS */
345 351
346 mci->mod_name = EDAC_MOD_STR; 352 mci->mod_name = EDAC_MOD_STR;
347 mci->mod_ver = "$Revision: 1.5.2.11 $"; 353 mci->mod_ver = I82875P_REVISION;
348 mci->ctl_name = i82875p_devs[dev_idx].ctl_name; 354 mci->ctl_name = i82875p_devs[dev_idx].ctl_name;
349 mci->edac_check = i82875p_check; 355 mci->edac_check = i82875p_check;
350 mci->ctl_page_to_phys = NULL; 356 mci->ctl_page_to_phys = NULL;
@@ -437,7 +443,7 @@ static void __devexit i82875p_remove_one(struct pci_dev *pdev)
437 443
438 debugf0("%s()\n", __func__); 444 debugf0("%s()\n", __func__);
439 445
440 if ((mci = edac_mc_del_mc(pdev)) == NULL) 446 if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL)
441 return; 447 return;
442 448
443 pvt = (struct i82875p_pvt *) mci->pvt_info; 449 pvt = (struct i82875p_pvt *) mci->pvt_info;