mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
pci: Trivial device model conversions to realize
Convert the device models where initialization obviously can't fail. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Gonglei <arei.gonglei@huawei.com>
This commit is contained in:
parent
7ee6c1e182
commit
9af21dbee1
34 changed files with 87 additions and 152 deletions
|
@ -26,7 +26,7 @@ typedef struct EHCIPCIInfo {
|
|||
bool companion;
|
||||
} EHCIPCIInfo;
|
||||
|
||||
static int usb_ehci_pci_initfn(PCIDevice *dev)
|
||||
static void usb_ehci_pci_realize(PCIDevice *dev, Error **errp)
|
||||
{
|
||||
EHCIPCIState *i = PCI_EHCI(dev);
|
||||
EHCIState *s = &i->ehci;
|
||||
|
@ -66,8 +66,6 @@ static int usb_ehci_pci_initfn(PCIDevice *dev)
|
|||
|
||||
usb_ehci_realize(s, DEVICE(dev), NULL);
|
||||
pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->mem);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void usb_ehci_pci_init(Object *obj)
|
||||
|
@ -139,7 +137,7 @@ static void ehci_class_init(ObjectClass *klass, void *data)
|
|||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = usb_ehci_pci_initfn;
|
||||
k->realize = usb_ehci_pci_realize;
|
||||
k->exit = usb_ehci_pci_exit;
|
||||
k->class_id = PCI_CLASS_SERIAL_USB;
|
||||
k->config_write = usb_ehci_pci_write_config;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue