[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 15/30] isa/*: QOM casting sweep
From: |
peter . crosthwaite |
Subject: |
[Qemu-devel] [PATCH v2 15/30] isa/*: QOM casting sweep |
Date: |
Mon, 24 Jun 2013 17:00:59 +1000 |
From: Peter Crosthwaite <address@hidden>
Use standard QOM cast macros. Remove usage of DO_UPCAST and
direct -> style upcasting.
Signed-off-by: Peter Crosthwaite <address@hidden>
---
hw/isa/i82378.c | 8 ++++----
hw/isa/lpc_ich9.c | 6 +++---
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/hw/isa/i82378.c b/hw/isa/i82378.c
index a24cb98..d6fef8c 100644
--- a/hw/isa/i82378.c
+++ b/hw/isa/i82378.c
@@ -159,8 +159,7 @@ static void i82378_request_out0_irq(void *opaque, int irq,
int level)
static void i82378_request_pic_irq(void *opaque, int irq, int level)
{
- DeviceState *dev = opaque;
- PCIDevice *pci = DO_UPCAST(PCIDevice, qdev, dev);
+ PCIDevice *pci = PCI_DEVICE(opaque);
PCIi82378State *s = DO_UPCAST(PCIi82378State, pci_dev, pci);
qemu_set_irq(s->state.i8259[irq], level);
@@ -210,6 +209,7 @@ static void i82378_init(DeviceState *dev, I82378State *s)
static int pci_i82378_init(PCIDevice *dev)
{
PCIi82378State *pci = DO_UPCAST(PCIi82378State, pci_dev, dev);
+ DeviceState *d = DEVICE(pci);
I82378State *s = &pci->state;
uint8_t *pci_conf;
@@ -233,9 +233,9 @@ static int pci_i82378_init(PCIDevice *dev)
pci_set_long(pci_conf + PCI_BASE_ADDRESS_0, pci->isa_io_base);
isa_mem_base = pci->isa_mem_base;
- isa_bus_new(&dev->qdev, pci_address_space_io(dev));
+ isa_bus_new(d, pci_address_space_io(dev));
- i82378_init(&dev->qdev, s);
+ i82378_init(d, s);
return 0;
}
diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index 667e882..497ced1 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -277,7 +277,7 @@ void ich9_lpc_set_irq(void *opaque, int pirq, int level)
*/
int ich9_lpc_map_irq(PCIDevice *pci_dev, int intx)
{
- BusState *bus = qdev_get_parent_bus(&pci_dev->qdev);
+ BusState *bus = qdev_get_parent_bus(DEVICE(pci_dev));
PCIBus *pci_bus = PCI_BUS(bus);
PCIDevice *lpc_pdev =
pci_bus->devices[PCI_DEVFN(ICH9_LPC_DEV, ICH9_LPC_FUNC)];
@@ -364,7 +364,7 @@ void ich9_lpc_pm_init(PCIDevice *lpc_pci)
sci_irq = qemu_allocate_irqs(ich9_set_sci, lpc, 1);
ich9_pm_init(lpc_pci, &lpc->pm, sci_irq[0]);
- ich9_lpc_reset(&lpc->d.qdev);
+ ich9_lpc_reset(DEVICE(lpc));
}
/* APM */
@@ -529,7 +529,7 @@ static int ich9_lpc_initfn(PCIDevice *d)
ICH9LPCState *lpc = ICH9_LPC_DEVICE(d);
ISABus *isa_bus;
- isa_bus = isa_bus_new(&d->qdev, get_system_io());
+ isa_bus = isa_bus_new(DEVICE(d), get_system_io());
pci_set_long(d->wmask + ICH9_LPC_PMBASE,
ICH9_LPC_PMBASE_BASE_ADDRESS_MASK);
--
1.8.3.rc1.44.gb387c77.dirty
- [Qemu-devel] [PATCH v2 12/30] virtio/vmware_vga: QOM casting sweep, (continued)
- [Qemu-devel] [PATCH v2 12/30] virtio/vmware_vga: QOM casting sweep, peter . crosthwaite, 2013/06/24
- [Qemu-devel] [PATCH v2 13/30] misc/ivshmem: QOM Upcast Sweep, peter . crosthwaite, 2013/06/24
- [Qemu-devel] [PATCH v2 14/30] xen/xen_platform: QOM casting sweep, peter . crosthwaite, 2013/06/24
- [Qemu-devel] [PATCH v2 15/30] isa/*: QOM casting sweep,
peter . crosthwaite <=
- [Qemu-devel] [PATCH v2 16/30] pci/*: QOM casting sweep, peter . crosthwaite, 2013/06/24
- [Qemu-devel] [PATCH v2 17/30] pci-bridge/pci_bridge_dev: Don't use DO_UPCAST, peter . crosthwaite, 2013/06/24
- [Qemu-devel] [PATCH v2 18/30] pci-bridge/*: substitute ->qdev casts with DEVICE(), peter . crosthwaite, 2013/06/24
- [Qemu-devel] [PATCH v2 19/30] pci/pci_bridge: substitute ->qdev casts with DEVICE(), peter . crosthwaite, 2013/06/24
- [Qemu-devel] [PATCH v2 20/30] misc/vfio: substitute ->qdev casts with DEVICE(), peter . crosthwaite, 2013/06/24
- [Qemu-devel] [PATCH v2 21/30] net/eepro100: substitute ->qdev casts with DEVICE(), peter . crosthwaite, 2013/06/24
- [Qemu-devel] [PATCH v2 22/30] net/ne2000: substitute ->qdev casts with DEVICE(), peter . crosthwaite, 2013/06/24
- [Qemu-devel] [PATCH v2 23/30] usb/*: substitute ->qdev casts with DEVICE(), peter . crosthwaite, 2013/06/24
- [Qemu-devel] [PATCH v2 24/30] watchdog/wdt_i6300esb: substitute ->qdev casts with DEVICE(), peter . crosthwaite, 2013/06/24