summaryrefslogtreecommitdiff
path: root/src/southbridge/via
diff options
context:
space:
mode:
authorPatrick Georgi <patrick@georgi-clan.de>2012-07-26 19:48:23 +0200
committerPatrick Georgi <patrick@georgi-clan.de>2012-07-26 22:25:10 +0200
commitefff733ad83acf8502561a9cadc9202c6974e510 (patch)
treeb81785cd64f750ac790c5b4306dc4b0b16ca641c /src/southbridge/via
parent8730bf8aad995bf105454ac1a93dee4c7b5565d5 (diff)
Refactor driver structs
Our driver infrastructure became more flexible recently. Make use of it. These are the low hanging fruits (files with 5 device variants or more), but there are still lots of files with less potential for deduplication. Change-Id: If6b7be5046581f81485a511b150f99b029b95c3b Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/1358 Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/southbridge/via')
-rw-r--r--src/southbridge/via/k8t890/ctrl.c33
-rw-r--r--src/southbridge/via/k8t890/error.c33
2 files changed, 18 insertions, 48 deletions
diff --git a/src/southbridge/via/k8t890/ctrl.c b/src/southbridge/via/k8t890/ctrl.c
index fc851f8007..3b92493c91 100644
--- a/src/southbridge/via/k8t890/ctrl.c
+++ b/src/southbridge/via/k8t890/ctrl.c
@@ -193,32 +193,17 @@ static const struct device_operations ctrl_ops = {
.ops_pci = &lops_pci,
};
-static const struct pci_driver northbridge_driver_t800 __pci_driver = {
- .ops = &ctrl_ops,
- .vendor = PCI_VENDOR_ID_VIA,
- .device = PCI_DEVICE_ID_VIA_K8T800_NB_SB_CTR,
-};
-
-static const struct pci_driver northbridge_driver_m800 __pci_driver = {
- .ops = &ctrl_ops,
- .vendor = PCI_VENDOR_ID_VIA,
- .device = PCI_DEVICE_ID_VIA_K8M800_NB_SB_CTR,
-};
-
-static const struct pci_driver northbridge_driver_t890 __pci_driver = {
- .ops = &ctrl_ops,
- .vendor = PCI_VENDOR_ID_VIA,
- .device = PCI_DEVICE_ID_VIA_K8T890CE_7,
-};
-
-static const struct pci_driver northbridge_driver_t890cf __pci_driver = {
- .ops = &ctrl_ops,
- .vendor = PCI_VENDOR_ID_VIA,
- .device = PCI_DEVICE_ID_VIA_K8T890CF_7,
+static const unsigned short ctrl_ids[] = {
+ PCI_DEVICE_ID_VIA_K8T800_NB_SB_CTR,
+ PCI_DEVICE_ID_VIA_K8M800_NB_SB_CTR,
+ PCI_DEVICE_ID_VIA_K8T890CE_7,
+ PCI_DEVICE_ID_VIA_K8T890CF_7,
+ PCI_DEVICE_ID_VIA_K8M890CE_7,
+ 0
};
-static const struct pci_driver northbridge_driver_m890 __pci_driver = {
+static const struct pci_driver northbridge_driver_t800 __pci_driver = {
.ops = &ctrl_ops,
.vendor = PCI_VENDOR_ID_VIA,
- .device = PCI_DEVICE_ID_VIA_K8M890CE_7,
+ .devices= ctrl_ids,
};
diff --git a/src/southbridge/via/k8t890/error.c b/src/southbridge/via/k8t890/error.c
index 1f6979a31e..846ccfbfc6 100644
--- a/src/southbridge/via/k8t890/error.c
+++ b/src/southbridge/via/k8t890/error.c
@@ -53,32 +53,17 @@ static const struct device_operations error_ops = {
.ops_pci = &lops_pci,
};
-static const struct pci_driver northbridge_driver_t800 __pci_driver = {
- .ops = &error_ops,
- .vendor = PCI_VENDOR_ID_VIA,
- .device = PCI_DEVICE_ID_VIA_K8T800_ERR,
-};
-
-static const struct pci_driver northbridge_driver_m800 __pci_driver = {
- .ops = &error_ops,
- .vendor = PCI_VENDOR_ID_VIA,
- .device = PCI_DEVICE_ID_VIA_K8M800_ERR,
-};
-
-static const struct pci_driver northbridge_driver_t890 __pci_driver = {
- .ops = &error_ops,
- .vendor = PCI_VENDOR_ID_VIA,
- .device = PCI_DEVICE_ID_VIA_K8T890CE_1,
-};
-
-static const struct pci_driver northbridge_driver_tcf __pci_driver = {
- .ops = &error_ops,
- .vendor = PCI_VENDOR_ID_VIA,
- .device = PCI_DEVICE_ID_VIA_K8T890CF_1,
+static const unsigned short error_ids[] = {
+ PCI_DEVICE_ID_VIA_K8T800_ERR,
+ PCI_DEVICE_ID_VIA_K8M800_ERR,
+ PCI_DEVICE_ID_VIA_K8T890CE_1,
+ PCI_DEVICE_ID_VIA_K8T890CF_1,
+ PCI_DEVICE_ID_VIA_K8M890CE_1,
+ 0
};
-static const struct pci_driver northbridge_driver_m __pci_driver = {
+static const struct pci_driver northbridge_driver_t800 __pci_driver = {
.ops = &error_ops,
.vendor = PCI_VENDOR_ID_VIA,
- .device = PCI_DEVICE_ID_VIA_K8M890CE_1,
+ .devices= error_ids,
};