summaryrefslogtreecommitdiff
path: root/hw/usb-ohci.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-08-24 18:42:48 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-08-27 20:46:59 -0500
commit505da59965a564504111dfc16ed8cf984b41d45f (patch)
tree2fe9fa0219d1c9c68587469564758652f1d6d464 /hw/usb-ohci.c
parenta4a2f59cda3c88eb647d651e0e0c5f1933b646b3 (diff)
downloadqemu-505da59965a564504111dfc16ed8cf984b41d45f.tar.gz
qemu-505da59965a564504111dfc16ed8cf984b41d45f.tar.bz2
qemu-505da59965a564504111dfc16ed8cf984b41d45f.zip
usb-ohci: Change casts to DO_UPCAST() for OHCIPCIState
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/usb-ohci.c')
-rw-r--r--hw/usb-ohci.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c
index 093623fc42..0c08e9fff3 100644
--- a/hw/usb-ohci.c
+++ b/hw/usb-ohci.c
@@ -1706,7 +1706,7 @@ typedef struct {
static void ohci_mapfunc(PCIDevice *pci_dev, int i,
uint32_t addr, uint32_t size, int type)
{
- OHCIPCIState *ohci = (OHCIPCIState *)pci_dev;
+ OHCIPCIState *ohci = DO_UPCAST(OHCIPCIState, pci_dev, pci_dev);
cpu_register_physical_memory(addr, size, ohci->state.mem);
}
@@ -1714,8 +1714,9 @@ void usb_ohci_init_pci(struct PCIBus *bus, int num_ports, int devfn)
{
OHCIPCIState *ohci;
- ohci = (OHCIPCIState *)pci_register_device(bus, "OHCI USB", sizeof(*ohci),
- devfn, NULL, NULL);
+ ohci = DO_UPCAST(OHCIPCIState, pci_dev,
+ pci_register_device(bus, "OHCI USB", sizeof(*ohci),
+ devfn, NULL, NULL));
if (ohci == NULL) {
fprintf(stderr, "usb-ohci: Failed to register PCI device\n");
return;