[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 12/96] ide/ich: Convert to realize
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 12/96] ide/ich: Convert to realize |
Date: |
Wed, 18 Feb 2015 22:45:13 +0100 |
From: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Gonglei <address@hidden>
---
hw/ide/ich.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/hw/ide/ich.c b/hw/ide/ich.c
index fb1d095..b1d8874 100644
--- a/hw/ide/ich.c
+++ b/hw/ide/ich.c
@@ -98,7 +98,7 @@ static void pci_ich9_reset(DeviceState *dev)
ahci_reset(&d->ahci);
}
-static int pci_ich9_ahci_init(PCIDevice *dev)
+static void pci_ich9_ahci_realize(PCIDevice *dev, Error **errp)
{
struct AHCIPCIState *d;
int sata_cap_offset;
@@ -123,10 +123,11 @@ static int pci_ich9_ahci_init(PCIDevice *dev)
pci_register_bar(dev, ICH9_MEM_BAR, PCI_BASE_ADDRESS_SPACE_MEMORY,
&d->ahci.mem);
- sata_cap_offset = pci_add_capability(dev, PCI_CAP_ID_SATA,
- ICH9_SATA_CAP_OFFSET, SATA_CAP_SIZE);
+ sata_cap_offset = pci_add_capability2(dev, PCI_CAP_ID_SATA,
+ ICH9_SATA_CAP_OFFSET, SATA_CAP_SIZE,
+ errp);
if (sata_cap_offset < 0) {
- return sata_cap_offset;
+ return;
}
sata_cap = dev->config + sata_cap_offset;
@@ -139,8 +140,6 @@ static int pci_ich9_ahci_init(PCIDevice *dev)
* should be PMCAP, the Intel ICH9 data sheet specifies that the ICH9
* AHCI device puts the MSI capability first, pointing to 0x80. */
msi_init(dev, ICH9_MSI_CAP_OFFSET, 1, true, false);
-
- return 0;
}
static void pci_ich9_uninit(PCIDevice *dev)
@@ -158,7 +157,7 @@ static void ich_ahci_class_init(ObjectClass *klass, void
*data)
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
- k->init = pci_ich9_ahci_init;
+ k->realize = pci_ich9_ahci_realize;
k->exit = pci_ich9_uninit;
k->vendor_id = PCI_VENDOR_ID_INTEL;
k->device_id = PCI_DEVICE_ID_INTEL_82801IR;
--
MST
- [Qemu-devel] [PULL 01/96] acpi-build: fix memory leak with bridge hp off, (continued)
- [Qemu-devel] [PULL 01/96] acpi-build: fix memory leak with bridge hp off, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 03/96] acpi: move generic aml building helpers into dedictated file, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 04/96] acpi: add build_append_namestring() helper, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 05/96] acpi: drop min-bytes in build_package(), Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 06/96] pci: Convert core to realize, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 07/96] pci: Permit incremental conversion of device models to realize, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 08/96] pci: Trivial device model conversions to realize, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 09/96] pcnet: pcnet_common_init() always returns 0, change to void, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 10/96] pcnet: Convert to realize, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 11/96] serial-pci: Convert to realize, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 12/96] ide/ich: Convert to realize,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 13/96] cirrus-vga: Convert to realize, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 14/96] qxl: Convert to realize, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 15/96] pci-assign: Convert to realize, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 17/96] acpi, pc: Add hotunplug request cb for pc machine., Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 16/96] qdev: Don't exit when running into bad -global, Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 18/96] acpi, ich9: Add hotunplug request cb for ich9., Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 19/96] acpi, pc: Add unplug cb for pc machine., Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 20/96] acpi, ich9: Add unplug cb for ich9., Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 21/96] acpi, piix4: Add unplug cb for piix4., Michael S. Tsirkin, 2015/02/18
- [Qemu-devel] [PULL 22/96] vl.c: Fix error messages when parsing maxmem parameters, Michael S. Tsirkin, 2015/02/18