提交 fef7fbc9 编写于 作者: A Andreas Färber

qdev: Drop FROM_QBUS() macro

Use QOM cast macros I2C_BUS(), SSI_BUS(), PCI_BUS() instead.
Signed-off-by: NAndreas Färber <afaerber@suse.de>
上级 4a17cc4f
...@@ -66,7 +66,7 @@ i2c_bus *i2c_init_bus(DeviceState *parent, const char *name) ...@@ -66,7 +66,7 @@ i2c_bus *i2c_init_bus(DeviceState *parent, const char *name)
{ {
i2c_bus *bus; i2c_bus *bus;
bus = FROM_QBUS(i2c_bus, qbus_create(TYPE_I2C_BUS, parent, name)); bus = I2C_BUS(qbus_create(TYPE_I2C_BUS, parent, name));
vmstate_register(NULL, -1, &vmstate_i2c_bus, bus); vmstate_register(NULL, -1, &vmstate_i2c_bus, bus);
return bus; return bus;
} }
...@@ -183,7 +183,7 @@ static int i2c_slave_post_load(void *opaque, int version_id) ...@@ -183,7 +183,7 @@ static int i2c_slave_post_load(void *opaque, int version_id)
{ {
I2CSlave *dev = opaque; I2CSlave *dev = opaque;
i2c_bus *bus; i2c_bus *bus;
bus = FROM_QBUS(i2c_bus, qdev_get_parent_bus(&dev->qdev)); bus = I2C_BUS(qdev_get_parent_bus(DEVICE(dev)));
if (bus->saved_address == dev->address) { if (bus->saved_address == dev->address) {
bus->current_dev = dev; bus->current_dev = dev;
} }
......
...@@ -1700,7 +1700,7 @@ static int pci_qdev_init(DeviceState *qdev) ...@@ -1700,7 +1700,7 @@ static int pci_qdev_init(DeviceState *qdev)
pci_dev->cap_present |= QEMU_PCI_CAP_EXPRESS; pci_dev->cap_present |= QEMU_PCI_CAP_EXPRESS;
} }
bus = FROM_QBUS(PCIBus, qdev_get_parent_bus(qdev)); bus = PCI_BUS(qdev_get_parent_bus(qdev));
pci_dev = do_pci_register_device(pci_dev, bus, pci_dev = do_pci_register_device(pci_dev, bus,
object_get_typename(OBJECT(qdev)), object_get_typename(OBJECT(qdev)),
pci_dev->devfn); pci_dev->devfn);
......
...@@ -103,7 +103,7 @@ SSIBus *ssi_create_bus(DeviceState *parent, const char *name) ...@@ -103,7 +103,7 @@ SSIBus *ssi_create_bus(DeviceState *parent, const char *name)
{ {
BusState *bus; BusState *bus;
bus = qbus_create(TYPE_SSI_BUS, parent, name); bus = qbus_create(TYPE_SSI_BUS, parent, name);
return FROM_QBUS(SSIBus, bus); return SSI_BUS(bus);
} }
uint32_t ssi_transfer(SSIBus *bus, uint32_t val) uint32_t ssi_transfer(SSIBus *bus, uint32_t val)
......
...@@ -261,8 +261,6 @@ void qbus_reset_all_fn(void *opaque); ...@@ -261,8 +261,6 @@ void qbus_reset_all_fn(void *opaque);
void qbus_free(BusState *bus); void qbus_free(BusState *bus);
#define FROM_QBUS(type, dev) DO_UPCAST(type, qbus, dev)
/* This should go away once we get rid of the NULL bus hack */ /* This should go away once we get rid of the NULL bus hack */
BusState *sysbus_get_default(void); BusState *sysbus_get_default(void);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册