diff options
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/e752x_edac.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c index 725bc397458e..b2d71388172b 100644 --- a/drivers/edac/e752x_edac.c +++ b/drivers/edac/e752x_edac.c | |||
@@ -209,7 +209,6 @@ enum e752x_chips { | |||
209 | */ | 209 | */ |
210 | 210 | ||
211 | struct e752x_pvt { | 211 | struct e752x_pvt { |
212 | struct pci_dev *bridge_ck; | ||
213 | struct pci_dev *dev_d0f0; | 212 | struct pci_dev *dev_d0f0; |
214 | struct pci_dev *dev_d0f1; | 213 | struct pci_dev *dev_d0f1; |
215 | u32 tolm; | 214 | u32 tolm; |
@@ -891,7 +890,7 @@ static void e752x_get_error_info(struct mem_ctl_info *mci, | |||
891 | info->buf_ferr); | 890 | info->buf_ferr); |
892 | 891 | ||
893 | if (info->dram_ferr) | 892 | if (info->dram_ferr) |
894 | pci_write_bits16(pvt->bridge_ck, E752X_DRAM_FERR, | 893 | pci_write_bits16(pvt->dev_d0f1, E752X_DRAM_FERR, |
895 | info->dram_ferr, info->dram_ferr); | 894 | info->dram_ferr, info->dram_ferr); |
896 | 895 | ||
897 | pci_write_config_dword(dev, E752X_FERR_GLOBAL, | 896 | pci_write_config_dword(dev, E752X_FERR_GLOBAL, |
@@ -936,7 +935,7 @@ static void e752x_get_error_info(struct mem_ctl_info *mci, | |||
936 | info->buf_nerr); | 935 | info->buf_nerr); |
937 | 936 | ||
938 | if (info->dram_nerr) | 937 | if (info->dram_nerr) |
939 | pci_write_bits16(pvt->bridge_ck, E752X_DRAM_NERR, | 938 | pci_write_bits16(pvt->dev_d0f1, E752X_DRAM_NERR, |
940 | info->dram_nerr, info->dram_nerr); | 939 | info->dram_nerr, info->dram_nerr); |
941 | 940 | ||
942 | pci_write_config_dword(dev, E752X_NERR_GLOBAL, | 941 | pci_write_config_dword(dev, E752X_NERR_GLOBAL, |
@@ -1177,38 +1176,33 @@ static void e752x_init_mem_map_table(struct pci_dev *pdev, | |||
1177 | static int e752x_get_devs(struct pci_dev *pdev, int dev_idx, | 1176 | static int e752x_get_devs(struct pci_dev *pdev, int dev_idx, |
1178 | struct e752x_pvt *pvt) | 1177 | struct e752x_pvt *pvt) |
1179 | { | 1178 | { |
1180 | struct pci_dev *dev; | 1179 | pvt->dev_d0f1 = pci_get_device(PCI_VENDOR_ID_INTEL, |
1181 | |||
1182 | pvt->bridge_ck = pci_get_device(PCI_VENDOR_ID_INTEL, | ||
1183 | pvt->dev_info->err_dev, NULL); | 1180 | pvt->dev_info->err_dev, NULL); |
1184 | 1181 | ||
1185 | if (pvt->bridge_ck == NULL) { | 1182 | if (pvt->dev_d0f1 == NULL) { |
1186 | pvt->bridge_ck = pci_scan_single_device(pdev->bus, | 1183 | pvt->dev_d0f1 = pci_scan_single_device(pdev->bus, |
1187 | PCI_DEVFN(0, 1)); | 1184 | PCI_DEVFN(0, 1)); |
1188 | pci_dev_get(pvt->bridge_ck); | 1185 | pci_dev_get(pvt->dev_d0f1); |
1189 | } | 1186 | } |
1190 | 1187 | ||
1191 | if (pvt->bridge_ck == NULL) { | 1188 | if (pvt->dev_d0f1 == NULL) { |
1192 | e752x_printk(KERN_ERR, "error reporting device not found:" | 1189 | e752x_printk(KERN_ERR, "error reporting device not found:" |
1193 | "vendor %x device 0x%x (broken BIOS?)\n", | 1190 | "vendor %x device 0x%x (broken BIOS?)\n", |
1194 | PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].err_dev); | 1191 | PCI_VENDOR_ID_INTEL, e752x_devs[dev_idx].err_dev); |
1195 | return 1; | 1192 | return 1; |
1196 | } | 1193 | } |
1197 | 1194 | ||
1198 | dev = pci_get_device(PCI_VENDOR_ID_INTEL, | 1195 | pvt->dev_d0f0 = pci_get_device(PCI_VENDOR_ID_INTEL, |
1199 | e752x_devs[dev_idx].ctl_dev, | 1196 | e752x_devs[dev_idx].ctl_dev, |
1200 | NULL); | 1197 | NULL); |
1201 | 1198 | ||
1202 | if (dev == NULL) | 1199 | if (pvt->dev_d0f0 == NULL) |
1203 | goto fail; | 1200 | goto fail; |
1204 | 1201 | ||
1205 | pvt->dev_d0f0 = dev; | ||
1206 | pvt->dev_d0f1 = pci_dev_get(pvt->bridge_ck); | ||
1207 | |||
1208 | return 0; | 1202 | return 0; |
1209 | 1203 | ||
1210 | fail: | 1204 | fail: |
1211 | pci_dev_put(pvt->bridge_ck); | 1205 | pci_dev_put(pvt->dev_d0f1); |
1212 | return 1; | 1206 | return 1; |
1213 | } | 1207 | } |
1214 | 1208 | ||
@@ -1385,7 +1379,6 @@ static int e752x_probe1(struct pci_dev *pdev, int dev_idx) | |||
1385 | fail: | 1379 | fail: |
1386 | pci_dev_put(pvt->dev_d0f0); | 1380 | pci_dev_put(pvt->dev_d0f0); |
1387 | pci_dev_put(pvt->dev_d0f1); | 1381 | pci_dev_put(pvt->dev_d0f1); |
1388 | pci_dev_put(pvt->bridge_ck); | ||
1389 | edac_mc_free(mci); | 1382 | edac_mc_free(mci); |
1390 | 1383 | ||
1391 | return -ENODEV; | 1384 | return -ENODEV; |
@@ -1419,7 +1412,6 @@ static void e752x_remove_one(struct pci_dev *pdev) | |||
1419 | pvt = (struct e752x_pvt *)mci->pvt_info; | 1412 | pvt = (struct e752x_pvt *)mci->pvt_info; |
1420 | pci_dev_put(pvt->dev_d0f0); | 1413 | pci_dev_put(pvt->dev_d0f0); |
1421 | pci_dev_put(pvt->dev_d0f1); | 1414 | pci_dev_put(pvt->dev_d0f1); |
1422 | pci_dev_put(pvt->bridge_ck); | ||
1423 | edac_mc_free(mci); | 1415 | edac_mc_free(mci); |
1424 | } | 1416 | } |
1425 | 1417 | ||