usb-ohci: convert to pci_register_bar_simple()
Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
27a4154324
commit
6e964ded1e
|
@ -1713,13 +1713,6 @@ typedef struct {
|
|||
OHCIState state;
|
||||
} OHCIPCIState;
|
||||
|
||||
static void ohci_mapfunc(PCIDevice *pci_dev, int i,
|
||||
pcibus_t addr, pcibus_t size, int type)
|
||||
{
|
||||
OHCIPCIState *ohci = DO_UPCAST(OHCIPCIState, pci_dev, pci_dev);
|
||||
cpu_register_physical_memory(addr, size, ohci->state.mem);
|
||||
}
|
||||
|
||||
static int usb_ohci_initfn_pci(struct PCIDevice *dev)
|
||||
{
|
||||
OHCIPCIState *ohci = DO_UPCAST(OHCIPCIState, pci_dev, dev);
|
||||
|
@ -1737,8 +1730,7 @@ static int usb_ohci_initfn_pci(struct PCIDevice *dev)
|
|||
ohci->state.irq = ohci->pci_dev.irq[0];
|
||||
|
||||
/* TODO: avoid cast below by using dev */
|
||||
pci_register_bar(&ohci->pci_dev, 0, 256,
|
||||
PCI_BASE_ADDRESS_SPACE_MEMORY, ohci_mapfunc);
|
||||
pci_register_bar_simple(&ohci->pci_dev, 0, 256, 0, ohci->state.mem);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue