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
10
hw/pci.c
10
hw/pci.c
@ -1681,10 +1681,12 @@ static int pci_qdev_init(DeviceState *qdev, DeviceInfo *base)
|
||||
do_pci_unregister_device(pci_dev);
|
||||
return -1;
|
||||
}
|
||||
rc = info->init(pci_dev);
|
||||
if (rc != 0) {
|
||||
do_pci_unregister_device(pci_dev);
|
||||
return rc;
|
||||
if (info->init) {
|
||||
rc = info->init(pci_dev);
|
||||
if (rc != 0) {
|
||||
do_pci_unregister_device(pci_dev);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
/* rom loading */
|
||||
|
Loading…
Reference in New Issue
Block a user