See also commit 'pci: remove pci_config_set_vendor_id'. Signed-off-by: Hu Tao <hu...@cn.fujitsu.com> --- hw/block/nvme.c | 2 +- hw/pci-host/ppce500.c | 2 +- hw/pci/pci.c | 2 +- hw/pci/pci_bridge.c | 2 +- hw/virtio/virtio-pci.c | 2 +- include/hw/pci/pci.h | 6 ------ 6 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/hw/block/nvme.c b/hw/block/nvme.c index b6263dc..8d7ed78 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -768,7 +768,7 @@ static int nvme_init(PCIDevice *pci_dev) pci_conf = pci_dev->config; pci_conf[PCI_INTERRUPT_PIN] = 1; pci_config_set_prog_interface(pci_dev->config, 0x2); - pci_config_set_class(pci_dev->config, PCI_CLASS_STORAGE_EXPRESS); + pci_set_word(pci_dev->config + PCI_CLASS_DEVICE, PCI_CLASS_STORAGE_EXPRESS); pcie_endpoint_cap_init(&n->parent_obj, 0x80); n->num_namespaces = 1; diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index 1b4c0f0..aa4ed76 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -337,7 +337,7 @@ static int e500_pcihost_bridge_initfn(PCIDevice *d) PPCE500CCSRState *ccsr = CCSR(container_get(qdev_get_machine(), "/e500-ccsr")); - pci_config_set_class(d->config, PCI_CLASS_BRIDGE_PCI); + pci_set_word(d->config + PCI_CLASS_DEVICE, PCI_CLASS_BRIDGE_PCI); d->config[PCI_HEADER_TYPE] = (d->config[PCI_HEADER_TYPE] & PCI_HEADER_TYPE_MULTI_FUNCTION) | PCI_HEADER_TYPE_BRIDGE; diff --git a/hw/pci/pci.c b/hw/pci/pci.c index fdab941..05f8c9e 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -843,7 +843,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus, pci_set_word(pci_dev->config + PCI_VENDOR_ID, pc->vendor_id); pci_set_word(pci_dev->config + PCI_DEVICE_ID, pc->device_id); pci_set_byte(pci_dev->config + PCI_REVISION_ID, pc->revision); - pci_config_set_class(pci_dev->config, pc->class_id); + pci_set_word(pci_dev->config + PCI_CLASS_DEVICE, pc->class_id); if (!pc->is_bridge) { if (pc->subsystem_vendor_id || pc->subsystem_id) { diff --git a/hw/pci/pci_bridge.c b/hw/pci/pci_bridge.c index 40c97b1..04a5c10 100644 --- a/hw/pci/pci_bridge.c +++ b/hw/pci/pci_bridge.c @@ -350,7 +350,7 @@ int pci_bridge_initfn(PCIDevice *dev, const char *typename) * PCI_COMMAND_VGA_PALETTE); */ - pci_config_set_class(dev->config, PCI_CLASS_BRIDGE_PCI); + pci_set_word(dev->config + PCI_CLASS_DEVICE, PCI_CLASS_BRIDGE_PCI); dev->config[PCI_HEADER_TYPE] = (dev->config[PCI_HEADER_TYPE] & PCI_HEADER_TYPE_MULTI_FUNCTION) | PCI_HEADER_TYPE_BRIDGE; diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index dde1d73..c1bf96c 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -965,7 +965,7 @@ static void virtio_pci_device_plugged(DeviceState *d) config = proxy->pci_dev.config; if (proxy->class_code) { - pci_config_set_class(config, proxy->class_code); + pci_set_word(config + PCI_CLASS_DEVICE, proxy->class_code); } pci_set_word(config + PCI_SUBSYSTEM_VENDOR_ID, pci_get_word(config + PCI_VENDOR_ID)); diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 5106b44..eb9a2c3 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -462,12 +462,6 @@ pci_get_quad(const uint8_t *config) } static inline void -pci_config_set_class(uint8_t *pci_config, uint16_t val) -{ - pci_set_word(&pci_config[PCI_CLASS_DEVICE], val); -} - -static inline void pci_config_set_prog_interface(uint8_t *pci_config, uint8_t val) { pci_set_byte(&pci_config[PCI_CLASS_PROG], val); -- 1.9.3