aboutsummaryrefslogtreecommitdiff
path: root/hw/pci.c
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2011-06-15 07:37:47 +0900
committerMichael S. Tsirkin <mst@redhat.com>2011-06-15 18:32:08 +0300
commitc2afc92290f2b5a8eb6f7b75338815012f90a5c7 (patch)
treed4788cd54660f3a53fd959416aa9248e8fe020b8 /hw/pci.c
parentbefeac45d4d9afb587eca9a27d975db4a7950960 (diff)
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>
Diffstat (limited to 'hw/pci.c')
-rw-r--r--hw/pci.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/hw/pci.c b/hw/pci.c
index ba0598ba1d..b904a4ecb6 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 */