提交 16eaedf2 编写于 作者: G Gerd Hoffmann 提交者: Paul Brook

qdev/pci: misc fixes.

* fix secondary bus setup.
 * use base->name instead of "FIXME" for device name.
   Yes, the device name is redundant.  Only for drivers converted
   to qdev already though.  Once all drivers are converted we can
   and should kill it.
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
上级 042f84d0
...@@ -134,7 +134,8 @@ PCIBus *pci_register_bus(DeviceState *parent, const char *name, ...@@ -134,7 +134,8 @@ PCIBus *pci_register_bus(DeviceState *parent, const char *name,
static PCIBus *pci_register_secondary_bus(PCIDevice *dev, pci_map_irq_fn map_irq) static PCIBus *pci_register_secondary_bus(PCIDevice *dev, pci_map_irq_fn map_irq)
{ {
PCIBus *bus; PCIBus *bus;
bus = qemu_mallocz(sizeof(PCIBus));
bus = FROM_QBUS(PCIBus, qbus_create(&pci_bus_info, &dev->qdev, NULL));
bus->map_irq = map_irq; bus->map_irq = map_irq;
bus->parent_dev = dev; bus->parent_dev = dev;
bus->next = dev->bus->next; bus->next = dev->bus->next;
...@@ -890,7 +891,7 @@ static void pci_qdev_init(DeviceState *qdev, DeviceInfo *base) ...@@ -890,7 +891,7 @@ static void pci_qdev_init(DeviceState *qdev, DeviceInfo *base)
bus = FROM_QBUS(PCIBus, qdev_get_parent_bus(qdev)); bus = FROM_QBUS(PCIBus, qdev_get_parent_bus(qdev));
devfn = qdev_get_prop_int(qdev, "devfn", -1); devfn = qdev_get_prop_int(qdev, "devfn", -1);
pci_dev = do_pci_register_device(pci_dev, bus, "FIXME", devfn, pci_dev = do_pci_register_device(pci_dev, bus, base->name, devfn,
info->config_read, info->config_write); info->config_read, info->config_write);
assert(pci_dev); assert(pci_dev);
info->init(pci_dev); info->init(pci_dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册