pci: don't call qdev pci init method
As pci id initialization is moved to common layer, some initialization function can be empty. So don't call init method if NULL. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
befeac45d4
commit
c2afc92290
2
hw/pci.c
2
hw/pci.c
|
@ -1681,11 +1681,13 @@ static int pci_qdev_init(DeviceState *qdev, DeviceInfo *base)
|
|||
do_pci_unregister_device(pci_dev);
|
||||
return -1;
|
||||
}
|
||||
if (info->init) {
|
||||
rc = info->init(pci_dev);
|
||||
if (rc != 0) {
|
||||
do_pci_unregister_device(pci_dev);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
/* rom loading */
|
||||
is_default_rom = false;
|
||||
|
|
Loading…
Reference in a new issue