diff options
author | Aristeu Rozanski <arozansk@redhat.com> | 2013-10-30 12:27:03 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2013-11-14 13:49:27 -0500 |
commit | 5153a0f94cde059a64338f87698dce5c8fa3df8b (patch) | |
tree | f1169aa7a08f73b945703717ee984a07d11c3f0f | |
parent | cc311991a7ac68b60df1bb5ec26e4978cf66f6b0 (diff) |
sb_edac: enable multiple PCI id tables to be used
This is needed to allow separated PCI id tables for Sandy Bridge and Ivy
Bridge.
Signed-off-by: Aristeu Rozanski <arozansk@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r-- | drivers/edac/sb_edac.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c index 718f623f010f..8d53beeaa84e 100644 --- a/drivers/edac/sb_edac.c +++ b/drivers/edac/sb_edac.c | |||
@@ -1105,12 +1105,6 @@ static void sbridge_put_all_devices(void) | |||
1105 | } | 1105 | } |
1106 | } | 1106 | } |
1107 | 1107 | ||
1108 | /* | ||
1109 | * sbridge_get_all_devices Find and perform 'get' operation on the MCH's | ||
1110 | * device/functions we want to reference for this driver | ||
1111 | * | ||
1112 | * Need to 'get' device 16 func 1 and func 2 | ||
1113 | */ | ||
1114 | static int sbridge_get_onedevice(struct pci_dev **prev, | 1108 | static int sbridge_get_onedevice(struct pci_dev **prev, |
1115 | u8 *num_mc, | 1109 | u8 *num_mc, |
1116 | const struct pci_id_table *table, | 1110 | const struct pci_id_table *table, |
@@ -1212,11 +1206,21 @@ static int sbridge_get_onedevice(struct pci_dev **prev, | |||
1212 | return 0; | 1206 | return 0; |
1213 | } | 1207 | } |
1214 | 1208 | ||
1215 | static int sbridge_get_all_devices(u8 *num_mc) | 1209 | /* |
1210 | * sbridge_get_all_devices - Find and perform 'get' operation on the MCH's | ||
1211 | * device/functions we want to reference for this driver. | ||
1212 | * Need to 'get' device 16 func 1 and func 2. | ||
1213 | * @num_mc: pointer to the memory controllers count, to be incremented in case | ||
1214 | * of success. | ||
1215 | * @table: model specific table | ||
1216 | * | ||
1217 | * returns 0 in case of success or error code | ||
1218 | */ | ||
1219 | static int sbridge_get_all_devices(u8 *num_mc, | ||
1220 | const struct pci_id_table *table) | ||
1216 | { | 1221 | { |
1217 | int i, rc; | 1222 | int i, rc; |
1218 | struct pci_dev *pdev = NULL; | 1223 | struct pci_dev *pdev = NULL; |
1219 | const struct pci_id_table *table = pci_dev_descr_sbridge_table; | ||
1220 | 1224 | ||
1221 | while (table && table->descr) { | 1225 | while (table && table->descr) { |
1222 | for (i = 0; i < table->n_devs; i++) { | 1226 | for (i = 0; i < table->n_devs; i++) { |
@@ -1736,7 +1740,7 @@ static int sbridge_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1736 | } | 1740 | } |
1737 | probed++; | 1741 | probed++; |
1738 | 1742 | ||
1739 | rc = sbridge_get_all_devices(&num_mc); | 1743 | rc = sbridge_get_all_devices(&num_mc, pci_dev_descr_sbridge_table); |
1740 | if (unlikely(rc < 0)) | 1744 | if (unlikely(rc < 0)) |
1741 | goto fail0; | 1745 | goto fail0; |
1742 | mc = 0; | 1746 | mc = 0; |