summaryrefslogtreecommitdiffstats
path: root/hw
authorIsaku Yamahata <[email protected]>2011-06-14 22:37:47 (GMT)
committer Michael S. Tsirkin <[email protected]>2011-06-15 15:32:08 (GMT)
commitc2afc92290f2b5a8eb6f7b75338815012f90a5c7 (patch) (side-by-side diff)
treed4788cd54660f3a53fd959416aa9248e8fe020b8 /hw
parentbefeac45d4d9afb587eca9a27d975db4a7950960 (diff)
downloadqemu-kvm-c2afc92290f2b5a8eb6f7b75338815012f90a5c7.zip
qemu-kvm-c2afc92290f2b5a8eb6f7b75338815012f90a5c7.tar.gz
qemu-kvm-c2afc92290f2b5a8eb6f7b75338815012f90a5c7.tar.bz2
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 <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
Diffstat (limited to 'hw') (more/less context) (ignore whitespace changes)
-rw-r--r--hw/pci.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/hw/pci.c b/hw/pci.c
index ba0598b..b904a4e 100644
--- a/hw/pci.c
+++ b/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 */