From efff733ad83acf8502561a9cadc9202c6974e510 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Thu, 26 Jul 2012 19:48:23 +0200 Subject: 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 Reviewed-on: http://review.coreboot.org/1358 Reviewed-by: Stefan Reinauer Reviewed-by: Alexandru Gagniuc Tested-by: build bot (Jenkins) --- src/southbridge/nvidia/mcp55/pcie.c | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) (limited to 'src/southbridge/nvidia/mcp55/pcie.c') diff --git a/src/southbridge/nvidia/mcp55/pcie.c b/src/southbridge/nvidia/mcp55/pcie.c index cd43f878aa..108a9b1167 100644 --- a/src/southbridge/nvidia/mcp55/pcie.c +++ b/src/southbridge/nvidia/mcp55/pcie.c @@ -50,29 +50,17 @@ static struct device_operations pcie_ops = { // .enable = mcp55_enable, }; -static const struct pci_driver pciebc_driver __pci_driver = { - .ops = &pcie_ops, - .vendor = PCI_VENDOR_ID_NVIDIA, - .device = PCI_DEVICE_ID_NVIDIA_MCP55_PCIE_B_C, -}; -static const struct pci_driver pciee_driver __pci_driver = { - .ops = &pcie_ops, - .vendor = PCI_VENDOR_ID_NVIDIA, - .device = PCI_DEVICE_ID_NVIDIA_MCP55_PCIE_E, +static const unsigned short pcie_ids[] = { + PCI_DEVICE_ID_NVIDIA_MCP55_PCIE_B_C, + PCI_DEVICE_ID_NVIDIA_MCP55_PCIE_E, + PCI_DEVICE_ID_NVIDIA_MCP55_PCIE_A, + PCI_DEVICE_ID_NVIDIA_MCP55_PCIE_F, + PCI_DEVICE_ID_NVIDIA_MCP55_PCIE_D, + 0 }; -static const struct pci_driver pciea_driver __pci_driver = { - .ops = &pcie_ops, - .vendor = PCI_VENDOR_ID_NVIDIA, - .device = PCI_DEVICE_ID_NVIDIA_MCP55_PCIE_A, -}; -static const struct pci_driver pcief_driver __pci_driver = { - .ops = &pcie_ops, - .vendor = PCI_VENDOR_ID_NVIDIA, - .device = PCI_DEVICE_ID_NVIDIA_MCP55_PCIE_F, -}; -static const struct pci_driver pcied_driver __pci_driver = { + +static const struct pci_driver pciebc_driver __pci_driver = { .ops = &pcie_ops, .vendor = PCI_VENDOR_ID_NVIDIA, - .device = PCI_DEVICE_ID_NVIDIA_MCP55_PCIE_D, + .devices= pcie_ids, }; - -- cgit v1.2.3