mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-23 11:39:53 +00:00
xbox: Replace qdev_create with qdev_new
See "qdev: New qdev_new(), qdev_realize(), etc." for more info.
This commit is contained in:
parent
49b1750bac
commit
d67628c5bd
@ -28,6 +28,7 @@
|
||||
#include "hw/i2c/i2c.h"
|
||||
#include "hw/i2c/smbus_slave.h"
|
||||
#include "smbus.h"
|
||||
#include "qapi/error.h"
|
||||
|
||||
#define TYPE_SMBUS_ADM1032 "smbus-adm1032"
|
||||
#define SMBUS_ADM1032(obj) OBJECT_CHECK(SMBusADM1032Device, (obj), TYPE_SMBUS_ADM1032)
|
||||
@ -114,8 +115,8 @@ type_init(smbus_adm1032_register_devices)
|
||||
|
||||
void smbus_adm1032_init(I2CBus *smbus, int address)
|
||||
{
|
||||
DeviceState *tm;
|
||||
tm = qdev_create((BusState *)smbus, TYPE_SMBUS_ADM1032);
|
||||
qdev_prop_set_uint8(tm, "address", address);
|
||||
qdev_init_nofail(tm);
|
||||
DeviceState *dev;
|
||||
dev = qdev_new(TYPE_SMBUS_ADM1032);
|
||||
qdev_prop_set_uint8(dev, "address", address);
|
||||
qdev_realize_and_unref(dev, (BusState *)smbus, &error_fatal);
|
||||
}
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "hw/i2c/i2c.h"
|
||||
#include "hw/i2c/smbus_slave.h"
|
||||
#include "smbus.h"
|
||||
#include "qapi/error.h"
|
||||
|
||||
#define TYPE_SMBUS_CX25871 "smbus-cx25871"
|
||||
#define SMBUS_CX25871(obj) OBJECT_CHECK(SMBusCX25871Device, (obj), TYPE_SMBUS_CX25871)
|
||||
@ -111,8 +112,8 @@ type_init(smbus_cx25871_register_devices)
|
||||
|
||||
void smbus_cx25871_init(I2CBus *smbus, int address)
|
||||
{
|
||||
DeviceState *cx;
|
||||
cx = qdev_create((BusState *)smbus, TYPE_SMBUS_CX25871);
|
||||
qdev_prop_set_uint8(cx, "address", address);
|
||||
qdev_init_nofail(cx);
|
||||
DeviceState *dev;
|
||||
dev = qdev_new(TYPE_SMBUS_CX25871);
|
||||
qdev_prop_set_uint8(dev, "address", address);
|
||||
qdev_realize_and_unref(dev, (BusState *)smbus, &error_fatal);
|
||||
}
|
||||
|
@ -289,10 +289,10 @@ type_init(smbus_smc_register_devices)
|
||||
|
||||
void smbus_xbox_smc_init(I2CBus *smbus, int address)
|
||||
{
|
||||
DeviceState *smc;
|
||||
smc = qdev_create((BusState *)smbus, TYPE_XBOX_SMC);
|
||||
qdev_prop_set_uint8(smc, "address", address);
|
||||
qdev_init_nofail(smc);
|
||||
DeviceState *dev;
|
||||
dev = qdev_new(TYPE_XBOX_SMC);
|
||||
qdev_prop_set_uint8(dev, "address", address);
|
||||
qdev_realize_and_unref(dev, (BusState *)smbus, &error_fatal);
|
||||
}
|
||||
|
||||
static void xbox_assert_extsmi(void)
|
||||
|
@ -158,13 +158,12 @@ void xbox_pci_init(qemu_irq *pic,
|
||||
XBOX_PCIState *bridge_state;
|
||||
|
||||
/* pci host bus */
|
||||
host = qdev_create(NULL, "xbox-pcihost");
|
||||
host = qdev_new("xbox-pcihost");
|
||||
host_state = PCI_HOST_BRIDGE(host);
|
||||
|
||||
host_bus = pci_root_bus_new(host, NULL,
|
||||
pci_memory, address_space_io, 0, TYPE_PCI_BUS);
|
||||
host_bus = pci_root_bus_new(host, NULL, pci_memory,
|
||||
address_space_io, 0, TYPE_PCI_BUS);
|
||||
host_state->bus = host_bus;
|
||||
qdev_init_nofail(host);
|
||||
sysbus_realize_and_unref(SYS_BUS_DEVICE(host), &error_fatal);
|
||||
|
||||
bridge = pci_create_simple_multifunction(host_bus, PCI_DEVFN(0, 0),
|
||||
true, "xbox-pci");
|
||||
|
Loading…
Reference in New Issue
Block a user