drivers/edac: drivers to use new PCI operation
authorDave Jiang <djiang@mvista.com>
Thu, 19 Jul 2007 08:50:10 +0000 (01:50 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 19 Jul 2007 17:04:55 +0000 (10:04 -0700)
Move x86 drivers to new pci controller setup

Signed-off-by: Dave Jiang <djiang@mvista.com>
Signed-off-by: Douglas Thompson <dougthompson@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/edac/amd76x_edac.c
drivers/edac/e7xxx_edac.c
drivers/edac/i3000_edac.c
drivers/edac/i5000_edac.c
drivers/edac/i82443bxgx_edac.c
drivers/edac/i82860_edac.c
drivers/edac/i82875p_edac.c
drivers/edac/r82600_edac.c

index eaa225192098aabab4fba3774ff33df3cc8ac6eb..cc392eebee5c48a26582b72121d58c866929b6dc 100644 (file)
@@ -91,6 +91,8 @@ static const struct amd76x_dev_info amd76x_devs[] = {
                    .ctl_name = "AMD762"},
 };
 
+static struct edac_pci_ctl_info *amd76x_pci;
+
 /**
  *     amd76x_get_error_info   -       fetch error information
  *     @mci: Memory controller
@@ -266,6 +268,17 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx)
                goto fail;
        }
 
+       /* allocating generic PCI control info */
+       amd76x_pci = edac_pci_create_generic_ctl(&pdev->dev, EDAC_MOD_STR);
+       if (!amd76x_pci) {
+               printk(KERN_WARNING
+                       "%s(): Unable to create PCI control\n",
+                       __func__);
+               printk(KERN_WARNING
+                       "%s(): PCI error report via EDAC not setup\n",
+                       __func__);
+       }
+
        /* get this far and it's successful */
        debugf3("%s(): success\n", __func__);
        return 0;
@@ -299,6 +312,9 @@ static void __devexit amd76x_remove_one(struct pci_dev *pdev)
 
        debugf0("%s()\n", __func__);
 
+       if (amd76x_pci)
+               edac_pci_release_generic_ctl(amd76x_pci);
+
        if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL)
                return;
 
index 2b20610991c045655410fd8c4451bab2dda28b63..453ba346b6ca4d4011ffc186ec916ed999d73da2 100644 (file)
@@ -144,6 +144,8 @@ struct e7xxx_error_info {
        u32 dram_uelog_add;
 };
 
+static struct edac_pci_ctl_info *e7xxx_pci;
+
 static const struct e7xxx_dev_info e7xxx_devs[] = {
        [E7500] = {
                   .err_dev = PCI_DEVICE_ID_INTEL_7500_1_ERR,
@@ -481,6 +483,17 @@ static int e7xxx_probe1(struct pci_dev *pdev, int dev_idx)
                goto fail1;
        }
 
+       /* allocating generic PCI control info */
+       e7xxx_pci = edac_pci_create_generic_ctl(&pdev->dev, EDAC_MOD_STR);
+       if (!e7xxx_pci) {
+               printk(KERN_WARNING
+                       "%s(): Unable to create PCI control\n",
+                       __func__);
+               printk(KERN_WARNING
+                       "%s(): PCI error report via EDAC not setup\n",
+                       __func__);
+       }
+
        /* get this far and it's successful */
        debugf3("%s(): success\n", __func__);
        return 0;
@@ -512,6 +525,9 @@ static void __devexit e7xxx_remove_one(struct pci_dev *pdev)
 
        debugf0("%s()\n", __func__);
 
+       if (e7xxx_pci)
+               edac_pci_release_generic_ctl(e7xxx_pci);
+
        if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL)
                return;
 
index c8418fcea254f1872be75f0ff2b0e86a781c4b26..fa4c4d48756f99fa2da1a3d20af198bd91aedda1 100644 (file)
@@ -153,6 +153,7 @@ static const struct i3000_dev_info i3000_devs[] = {
 
 static struct pci_dev *mci_pdev = NULL;
 static int i3000_registered = 1;
+static struct edac_pci_ctl_info *i3000_pci;
 
 static void i3000_get_error_info(struct mem_ctl_info *mci,
                                 struct i3000_error_info *info)
@@ -373,6 +374,17 @@ static int i3000_probe1(struct pci_dev *pdev, int dev_idx)
                goto fail;
        }
 
+       /* allocating generic PCI control info */
+       i3000_pci = edac_pci_create_generic_ctl(&pdev->dev, EDAC_MOD_STR);
+       if (!i3000_pci) {
+               printk(KERN_WARNING
+                       "%s(): Unable to create PCI control\n",
+                       __func__);
+               printk(KERN_WARNING
+                       "%s(): PCI error report via EDAC not setup\n",
+                       __func__);
+       }
+
        /* get this far and it's successful */
        debugf3("MC: %s(): success\n", __func__);
        return 0;
@@ -408,6 +420,9 @@ static void __devexit i3000_remove_one(struct pci_dev *pdev)
 
        debugf0("%s()\n", __func__);
 
+       if (i3000_pci)
+               edac_pci_release_generic_ctl(i3000_pci);
+
        if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL)
                return;
 
index aa05c45efc087c0ef6933fd49b2f0a1a0325de7d..4b4ec978df2c348669d4c9db3132b7cd7b392dac 100644 (file)
@@ -28,6 +28,7 @@
  * Alter this version for the I5000 module when modifications are made
  */
 #define I5000_REVISION    " Ver: 2.0.12 " __DATE__
+#define EDAC_MOD_STR      "i5000_edac"
 
 #define i5000_printk(level, fmt, arg...) \
         edac_printk(level, "i5000", fmt, ##arg)
@@ -381,6 +382,8 @@ struct i5000_error_info {
 
 };
 
+static struct edac_pci_ctl_info *i5000_pci;
+
 /******************************************************************************
  *     i5000_get_error_info    Retrieve the hardware error information from
  *                             the hardware and cache it in the 'info'
@@ -1375,6 +1378,17 @@ static int i5000_probe1(struct pci_dev *pdev, int dev_idx)
 
        i5000_clear_error(mci);
 
+       /* allocating generic PCI control info */
+       i5000_pci = edac_pci_create_generic_ctl(&pdev->dev, EDAC_MOD_STR);
+       if (!i5000_pci) {
+               printk(KERN_WARNING
+                       "%s(): Unable to create PCI control\n",
+                       __func__);
+               printk(KERN_WARNING
+                       "%s(): PCI error report via EDAC not setup\n",
+                       __func__);
+       }
+
        return 0;
 
        /* Error exit unwinding stack */
@@ -1420,6 +1434,9 @@ static void __devexit i5000_remove_one(struct pci_dev *pdev)
 
        debugf0(__FILE__ ": %s()\n", __func__);
 
+       if (i5000_pci)
+               edac_pci_release_generic_ctl(i5000_pci);
+
        if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL)
                return;
 
index c0070aba87bb0adc85e4c0757e936ba347b8d7c4..d190104081ca1b5d568413b4a2747627154c6bbe 100644 (file)
@@ -111,6 +111,8 @@ struct i82443bxgx_edacmc_error_info {
        u32 eap;
 };
 
+static struct edac_pci_ctl_info *i82443bxgx_pci;
+
 static void i82443bxgx_edacmc_get_error_info(struct mem_ctl_info *mci,
                                             struct i82443bxgx_edacmc_error_info
                                             *info)
@@ -316,6 +318,17 @@ static int i82443bxgx_edacmc_probe1(struct pci_dev *pdev, int dev_idx)
                goto fail;
        }
 
+       /* allocating generic PCI control info */
+       i82443bxgx_pci = edac_pci_create_generic_ctl(&pdev->dev, EDAC_MOD_STR);
+       if (!i82443bxgx_pci) {
+               printk(KERN_WARNING
+                       "%s(): Unable to create PCI control\n",
+                       __func__);
+               printk(KERN_WARNING
+                       "%s(): PCI error report via EDAC not setup\n",
+                       __func__);
+       }
+
        debugf3("MC: " __FILE__ ": %s(): success\n", __func__);
        return 0;
 
@@ -342,6 +355,9 @@ static void __devexit i82443bxgx_edacmc_remove_one(struct pci_dev *pdev)
 
        debugf0(__FILE__ ": %s()\n", __func__);
 
+       if (i82443bxgx_pci)
+               edac_pci_release_generic_ctl(i82443bxgx_pci);
+
        if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL)
                return;
 
index bd7bbb733f79f3d64aa261eb1765b2a9c9972f20..db8a864f16f6fe68b5bd10f118925a6d6da903f8 100644 (file)
@@ -60,6 +60,7 @@ static const struct i82860_dev_info i82860_devs[] = {
 static struct pci_dev *mci_pdev = NULL;        /* init dev: in case that AGP code
                                         * has already registered driver
                                         */
+static struct edac_pci_ctl_info *i82860_pci;
 
 static void i82860_get_error_info(struct mem_ctl_info *mci,
                                  struct i82860_error_info *info)
@@ -213,6 +214,17 @@ static int i82860_probe1(struct pci_dev *pdev, int dev_idx)
                goto fail;
        }
 
+       /* allocating generic PCI control info */
+       i82860_pci = edac_pci_create_generic_ctl(&pdev->dev, EDAC_MOD_STR);
+       if (!i82860_pci) {
+               printk(KERN_WARNING
+                       "%s(): Unable to create PCI control\n",
+                       __func__);
+               printk(KERN_WARNING
+                       "%s(): PCI error report via EDAC not setup\n",
+                       __func__);
+       }
+
        /* get this far and it's successful */
        debugf3("%s(): success\n", __func__);
 
@@ -249,6 +261,9 @@ static void __devexit i82860_remove_one(struct pci_dev *pdev)
 
        debugf0("%s()\n", __func__);
 
+       if (i82860_pci)
+               edac_pci_release_generic_ctl(i82860_pci);
+
        if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL)
                return;
 
index 889ccf6ad85ccb82914199e5882cdf1f9540697e..214112b5e52a4a40adf522ec7642dc6199571a31 100644 (file)
@@ -183,6 +183,8 @@ static struct pci_dev *mci_pdev = NULL;     /* init dev: in case that AGP code has
 
 static int i82875p_registered = 1;
 
+static struct edac_pci_ctl_info *i82875p_pci;
+
 static void i82875p_get_error_info(struct mem_ctl_info *mci,
                                   struct i82875p_error_info *info)
 {
@@ -424,6 +426,17 @@ static int i82875p_probe1(struct pci_dev *pdev, int dev_idx)
                goto fail1;
        }
 
+       /* allocating generic PCI control info */
+       i82875p_pci = edac_pci_create_generic_ctl(&pdev->dev, EDAC_MOD_STR);
+       if (!i82875p_pci) {
+               printk(KERN_WARNING
+                       "%s(): Unable to create PCI control\n",
+                       __func__);
+               printk(KERN_WARNING
+                       "%s(): PCI error report via EDAC not setup\n",
+                       __func__);
+       }
+
        /* get this far and it's successful */
        debugf3("%s(): success\n", __func__);
        return 0;
@@ -467,6 +480,9 @@ static void __devexit i82875p_remove_one(struct pci_dev *pdev)
 
        debugf0("%s()\n", __func__);
 
+       if (i82875p_pci)
+               edac_pci_release_generic_ctl(i82875p_pci);
+
        if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL)
                return;
 
index 18206ce28d141d9b52635285fe801103031c93b2..8097f2faaa8cb186bdb5cbaab4a09641408d261b 100644 (file)
@@ -133,6 +133,8 @@ struct r82600_error_info {
 
 static unsigned int disable_hardware_scrub = 0;
 
+static struct edac_pci_ctl_info *r82600_pci;
+
 static void r82600_get_error_info(struct mem_ctl_info *mci,
                                  struct r82600_error_info *info)
 {
@@ -326,6 +328,17 @@ static int r82600_probe1(struct pci_dev *pdev, int dev_idx)
                pci_write_bits32(pdev, R82600_EAP, BIT(31), BIT(31));
        }
 
+       /* allocating generic PCI control info */
+       r82600_pci = edac_pci_create_generic_ctl(&pdev->dev, EDAC_MOD_STR);
+       if (!r82600_pci) {
+               printk(KERN_WARNING
+                       "%s(): Unable to create PCI control\n",
+                       __func__);
+               printk(KERN_WARNING
+                       "%s(): PCI error report via EDAC not setup\n",
+                       __func__);
+       }
+
        debugf3("%s(): success\n", __func__);
        return 0;
 
@@ -350,6 +363,9 @@ static void __devexit r82600_remove_one(struct pci_dev *pdev)
 
        debugf0("%s()\n", __func__);
 
+       if (r82600_pci)
+               edac_pci_release_generic_ctl(r82600_pci);
+
        if ((mci = edac_mc_del_mc(&pdev->dev)) == NULL)
                return;