mirror of https://github.com/xqemu/xqemu.git
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>
This commit is contained in:
parent
a4a2f59cda
commit
505da59965
|
@ -1706,7 +1706,7 @@ typedef struct {
|
||||||
static void ohci_mapfunc(PCIDevice *pci_dev, int i,
|
static void ohci_mapfunc(PCIDevice *pci_dev, int i,
|
||||||
uint32_t addr, uint32_t size, int type)
|
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);
|
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;
|
OHCIPCIState *ohci;
|
||||||
|
|
||||||
ohci = (OHCIPCIState *)pci_register_device(bus, "OHCI USB", sizeof(*ohci),
|
ohci = DO_UPCAST(OHCIPCIState, pci_dev,
|
||||||
devfn, NULL, NULL);
|
pci_register_device(bus, "OHCI USB", sizeof(*ohci),
|
||||||
|
devfn, NULL, NULL));
|
||||||
if (ohci == NULL) {
|
if (ohci == NULL) {
|
||||||
fprintf(stderr, "usb-ohci: Failed to register PCI device\n");
|
fprintf(stderr, "usb-ohci: Failed to register PCI device\n");
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue