aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/e752x_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/e752x_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/e752x_edac.c')
-rw-r--r--drivers/edac/e752x_edac.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c
index fce31936e6d7..de9f332eabf0 100644
--- a/drivers/edac/e752x_edac.c
+++ b/drivers/edac/e752x_edac.c
@@ -25,6 +25,8 @@
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include "edac_mc.h" 26#include "edac_mc.h"
27 27
28#define E752X_REVISION " Ver: 2.0.0 " __DATE__
29
28static int force_function_unhide; 30static int force_function_unhide;
29 31
30#define e752x_printk(level, fmt, arg...) \ 32#define e752x_printk(level, fmt, arg...) \
@@ -819,8 +821,8 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
819 EDAC_FLAG_S4ECD4ED; 821 EDAC_FLAG_S4ECD4ED;
820 /* FIXME - what if different memory types are in different csrows? */ 822 /* FIXME - what if different memory types are in different csrows? */
821 mci->mod_name = EDAC_MOD_STR; 823 mci->mod_name = EDAC_MOD_STR;
822 mci->mod_ver = "$Revision: 1.5.2.11 $"; 824 mci->mod_ver = E752X_REVISION;
823 mci->pdev = pdev; 825 mci->dev = &pdev->dev;
824 826
825 debugf3("%s(): init pvt\n", __func__); 827 debugf3("%s(): init pvt\n", __func__);
826 pvt = (struct e752x_pvt *) mci->pvt_info; 828 pvt = (struct e752x_pvt *) mci->pvt_info;
@@ -864,7 +866,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
864 struct csrow_info *csrow = &mci->csrows[index]; 866 struct csrow_info *csrow = &mci->csrows[index];
865 867
866 mem_dev = (mem_dev == 2); 868 mem_dev = (mem_dev == 2);
867 pci_read_config_byte(mci->pdev, E752X_DRB + index, &value); 869 pci_read_config_byte(pdev, E752X_DRB + index, &value);
868 /* convert a 128 or 64 MiB DRB to a page size. */ 870 /* convert a 128 or 64 MiB DRB to a page size. */
869 cumul_size = value << (25 + drc_drbg - PAGE_SHIFT); 871 cumul_size = value << (25 + drc_drbg - PAGE_SHIFT);
870 debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index, 872 debugf3("%s(): (%d) cumul_size 0x%x\n", __func__, index,
@@ -904,8 +906,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
904 u8 row = 0; 906 u8 row = 0;
905 907
906 for (index = 0; index < 8; index += 2) { 908 for (index = 0; index < 8; index += 2) {
907 pci_read_config_byte(mci->pdev, E752X_DRB + index, 909 pci_read_config_byte(pdev, E752X_DRB + index, &value);
908 &value);
909 910
910 /* test if there is a dimm in this slot */ 911 /* test if there is a dimm in this slot */
911 if (value == last) { 912 if (value == last) {
@@ -918,7 +919,7 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
918 last = value; 919 last = value;
919 /* test the next value to see if the dimm is 920 /* test the next value to see if the dimm is
920 double sided */ 921 double sided */
921 pci_read_config_byte(mci->pdev, 922 pci_read_config_byte(pdev,
922 E752X_DRB + index + 1, 923 E752X_DRB + index + 1,
923 &value); 924 &value);
924 pvt->map[index + 1] = (value == last) ? 925 pvt->map[index + 1] = (value == last) ?
@@ -935,18 +936,18 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx)
935 } 936 }
936 937
937 /* set the map type. 1 = normal, 0 = reversed */ 938 /* set the map type. 1 = normal, 0 = reversed */
938 pci_read_config_byte(mci->pdev, E752X_DRM, &stat8); 939 pci_read_config_byte(pdev, E752X_DRM, &stat8);
939 pvt->map_type = ((stat8 & 0x0f) > ((stat8 >> 4) & 0x0f)); 940 pvt->map_type = ((stat8 & 0x0f) > ((stat8 >> 4) & 0x0f));
940 941
941 mci->edac_cap |= EDAC_FLAG_NONE; 942 mci->edac_cap |= EDAC_FLAG_NONE;
942 debugf3("%s(): tolm, remapbase, remaplimit\n", __func__); 943 debugf3("%s(): tolm, remapbase, remaplimit\n", __func__);
943 944
944 /* load the top of low memory, remap base, and remap limit vars */ 945 /* load the top of low memory, remap base, and remap limit vars */
945 pci_read_config_word(mci->pdev, E752X_TOLM, &pci_data); 946 pci_read_config_word(pdev, E752X_TOLM, &pci_data);
946 pvt->tolm = ((u32) pci_data) << 4; 947 pvt->tolm = ((u32) pci_data) << 4;
947 pci_read_config_word(mci->pdev, E752X_REMAPBASE, &pci_data); 948 pci_read_config_word(pdev, E752X_REMAPBASE, &pci_data);
948 pvt->remapbase = ((u32) pci_data) << 14; 949 pvt->remapbase = ((u32) pci_data) << 14;
949 pci_read_config_word(mci->pdev, E752X_REMAPLIMIT, &pci_data); 950 pci_read_config_word(pdev, E752X_REMAPLIMIT, &pci_data);
950 pvt->remaplimit = ((u32) pci_data) << 14; 951 pvt->remaplimit = ((u32) pci_data) << 14;
951 e752x_printk(KERN_INFO, 952 e752x_printk(KERN_INFO,
952 "tolm = %x, remapbase = %x, remaplimit = %x\n", pvt->tolm, 953 "tolm = %x, remapbase = %x, remaplimit = %x\n", pvt->tolm,
@@ -1015,7 +1016,7 @@ static void __devexit e752x_remove_one(struct pci_dev *pdev)
1015 1016
1016 debugf0("%s()\n", __func__); 1017 debugf0("%s()\n", __func__);
1017 1018
1018 if ((mci = edac_mc_del_mc(pdev)) == NULL) 1019 if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL)
1019 return; 1020 return;
1020 1021
1021 pvt = (struct e752x_pvt *) mci->pvt_info; 1022 pvt = (struct e752x_pvt *) mci->pvt_info;