Index: src/southbridge/nvidia/ck804/ck804.h =================================================================== --- src/southbridge/nvidia/ck804/ck804.h (revision 6000) +++ src/southbridge/nvidia/ck804/ck804.h (working copy) @@ -26,4 +26,6 @@ void ck804_enable(device_t dev); void ck804_enable_usbdebug(unsigned int port); +extern struct pci_operations ck804_pci_ops; + #endif Index: src/southbridge/nvidia/ck804/ck804_sata.c =================================================================== --- src/southbridge/nvidia/ck804/ck804_sata.c (revision 6000) +++ src/southbridge/nvidia/ck804/ck804_sata.c (working copy) @@ -164,16 +164,6 @@ } -static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device) -{ - pci_write_config32(dev, 0x40, - ((device & 0xffff) << 16) | (vendor & 0xffff)); -} - -static struct pci_operations lops_pci = { - .set_subsystem = lpci_set_subsystem, -}; - static struct device_operations sata_ops = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, @@ -181,7 +171,7 @@ // .enable = ck804_enable, .init = sata_init, .scan_bus = 0, - .ops_pci = &lops_pci, + .ops_pci = &ck804_pci_ops, }; static const struct pci_driver sata0_driver __pci_driver = { Index: src/southbridge/nvidia/ck804/ck804_smbus.c =================================================================== --- src/southbridge/nvidia/ck804/ck804_smbus.c (revision 6000) +++ src/southbridge/nvidia/ck804/ck804_smbus.c (working copy) @@ -92,16 +92,6 @@ .write_byte = lsmbus_write_byte, }; -static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device) -{ - pci_write_config32(dev, 0x40, - ((device & 0xffff) << 16) | (vendor & 0xffff)); -} - -static struct pci_operations lops_pci = { - .set_subsystem = lpci_set_subsystem, -}; - static struct device_operations smbus_ops = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, @@ -109,7 +99,7 @@ .init = 0, .scan_bus = scan_static_bus, // .enable = ck804_enable, - .ops_pci = &lops_pci, + .ops_pci = &ck804_pci_ops, .ops_smbus_bus = &lops_smbus_bus, }; Index: src/southbridge/nvidia/ck804/ck804_usb.c =================================================================== --- src/southbridge/nvidia/ck804/ck804_usb.c (revision 6000) +++ src/southbridge/nvidia/ck804/ck804_usb.c (working copy) @@ -44,16 +44,6 @@ } } -static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device) -{ - pci_write_config32(dev, 0x40, - ((device & 0xffff) << 16) | (vendor & 0xffff)); -} - -static struct pci_operations lops_pci = { - .set_subsystem = lpci_set_subsystem, -}; - static struct device_operations usb_ops = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, @@ -61,7 +51,7 @@ .init = usb1_init, // .enable = ck804_enable, .scan_bus = 0, - .ops_pci = &lops_pci, + .ops_pci = &ck804_pci_ops, }; static const struct pci_driver usb_driver __pci_driver = { Index: src/southbridge/nvidia/ck804/ck804_ide.c =================================================================== --- src/southbridge/nvidia/ck804/ck804_ide.c (revision 6000) +++ src/southbridge/nvidia/ck804/ck804_ide.c (working copy) @@ -65,16 +65,6 @@ #endif } -static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device) -{ - pci_write_config32(dev, 0x40, - ((device & 0xffff) << 16) | (vendor & 0xffff)); -} - -static struct pci_operations lops_pci = { - .set_subsystem = lpci_set_subsystem, -}; - static struct device_operations ide_ops = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, @@ -82,7 +72,7 @@ .init = ide_init, .scan_bus = 0, // .enable = ck804_enable, - .ops_pci = &lops_pci, + .ops_pci = &ck804_pci_ops, }; static const struct pci_driver ide_driver __pci_driver = { Index: src/southbridge/nvidia/ck804/ck804_ac97.c =================================================================== --- src/southbridge/nvidia/ck804/ck804_ac97.c (revision 6000) +++ src/southbridge/nvidia/ck804/ck804_ac97.c (working copy) @@ -25,16 +25,6 @@ #include #include "ck804.h" -static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device) -{ - pci_write_config32(dev, 0x40, - ((device & 0xffff) << 16) | (vendor & 0xffff)); -} - -static struct pci_operations lops_pci = { - .set_subsystem = lpci_set_subsystem, -}; - static struct device_operations ac97audio_ops = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, @@ -42,7 +32,7 @@ // .enable = ck804_enable, .init = 0, .scan_bus = 0, - .ops_pci = &lops_pci, + .ops_pci = &ck804_pci_ops, }; static const struct pci_driver ac97audio_driver __pci_driver = { @@ -58,7 +48,7 @@ // .enable = ck804_enable, .init = 0, .scan_bus = 0, - .ops_pci = &lops_pci, + .ops_pci = &ck804_pci_ops, }; static const struct pci_driver ac97modem_driver __pci_driver = { Index: src/southbridge/nvidia/ck804/ck804_nic.c =================================================================== --- src/southbridge/nvidia/ck804/ck804_nic.c (revision 6000) +++ src/southbridge/nvidia/ck804/ck804_nic.c (working copy) @@ -113,16 +113,6 @@ #endif } -static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device) -{ - pci_write_config32(dev, 0x40, - ((device & 0xffff) << 16) | (vendor & 0xffff)); -} - -static struct pci_operations lops_pci = { - .set_subsystem = lpci_set_subsystem, -}; - static struct device_operations nic_ops = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, @@ -130,7 +120,7 @@ .init = nic_init, .scan_bus = 0, // .enable = ck804_enable, - .ops_pci = &lops_pci, + .ops_pci = &ck804_pci_ops, }; static const struct pci_driver nic_driver __pci_driver = { Index: src/southbridge/nvidia/ck804/ck804_ht.c =================================================================== --- src/southbridge/nvidia/ck804/ck804_ht.c (revision 6000) +++ src/southbridge/nvidia/ck804/ck804_ht.c (working copy) @@ -25,23 +25,13 @@ #include #include "ck804.h" -static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device) -{ - pci_write_config32(dev, 0x40, - ((device & 0xffff) << 16) | (vendor & 0xffff)); -} - -static struct pci_operations lops_pci = { - .set_subsystem = lpci_set_subsystem, -}; - static struct device_operations ht_ops = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, .init = 0, .scan_bus = 0, - .ops_pci = &lops_pci, + .ops_pci = &ck804_pci_ops, }; static const struct pci_driver ht_driver __pci_driver = { Index: src/southbridge/nvidia/ck804/ck804_usb2.c =================================================================== --- src/southbridge/nvidia/ck804/ck804_usb2.c (revision 6000) +++ src/southbridge/nvidia/ck804/ck804_usb2.c (working copy) @@ -33,16 +33,6 @@ pci_write_config32(dev, 0xf8, dword); } -static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device) -{ - pci_write_config32(dev, 0x40, - ((device & 0xffff) << 16) | (vendor & 0xffff)); -} - -static struct pci_operations lops_pci = { - .set_subsystem = lpci_set_subsystem, -}; - static struct device_operations usb2_ops = { .read_resources = pci_dev_read_resources, .set_resources = pci_dev_set_resources, @@ -50,7 +40,7 @@ .init = usb2_init, // .enable = ck804_enable, .scan_bus = 0, - .ops_pci = &lops_pci, + .ops_pci = &ck804_pci_ops, }; static const struct pci_driver usb2_driver __pci_driver = { Index: src/southbridge/nvidia/ck804/ck804_lpc.c =================================================================== --- src/southbridge/nvidia/ck804/ck804_lpc.c (revision 6000) +++ src/southbridge/nvidia/ck804/ck804_lpc.c (working copy) @@ -299,16 +299,6 @@ ck804_lpc_enable_childrens_resources(dev); } -static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device) -{ - pci_write_config32(dev, 0x40, - ((device & 0xffff) << 16) | (vendor & 0xffff)); -} - -static struct pci_operations lops_pci = { - .set_subsystem = lpci_set_subsystem, -}; - static struct device_operations lpc_ops = { .read_resources = ck804_lpc_read_resources, .set_resources = pci_dev_set_resources, @@ -316,7 +306,7 @@ .init = lpc_init, .scan_bus = scan_static_bus, // .enable = ck804_enable, - .ops_pci = &lops_pci, + .ops_pci = &ck804_pci_ops, }; static const struct pci_driver lpc_driver __pci_driver = { @@ -344,7 +334,7 @@ .enable_resources = pci_dev_enable_resources, .init = lpc_slave_init, // .enable = ck804_enable, - .ops_pci = &lops_pci, + .ops_pci = &ck804_pci_ops, }; static const struct pci_driver lpc_driver_slave __pci_driver = { Index: src/southbridge/nvidia/ck804/ck804.c =================================================================== --- src/southbridge/nvidia/ck804/ck804.c (revision 6000) +++ src/southbridge/nvidia/ck804/ck804.c (working copy) @@ -188,6 +188,16 @@ } } +static void ck804_set_subsystem(device_t dev, unsigned vendor, unsigned device) +{ + pci_write_config32(dev, 0x40, + ((device & 0xffff) << 16) | (vendor & 0xffff)); +} + +struct pci_operations ck804_pci_ops = { + .set_subsystem = ck804_set_subsystem, +}; + struct chip_operations southbridge_nvidia_ck804_ops = { CHIP_NAME("NVIDIA CK804 Southbridge") .enable_dev = ck804_enable,