diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2011-06-15 07:37:47 +0900 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2011-06-15 18:32:08 +0300 |
commit | c2afc92290f2b5a8eb6f7b75338815012f90a5c7 (patch) | |
tree | d4788cd54660f3a53fd959416aa9248e8fe020b8 /hw | |
parent | befeac45d4d9afb587eca9a27d975db4a7950960 (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')
-rw-r--r-- | hw/pci.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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 */ |