[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/26] ide/ahci/ich: use qdev.reset
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH 10/26] ide/ahci/ich: use qdev.reset |
Date: |
Wed, 16 Mar 2011 18:29:21 +0900 |
use DeviceInfo::reset callback instead of qemu_register_reset().
With this patch, its reset is done before parent pci device's reset.
Cc: Alexander Graf <address@hidden>
Signed-off-by: Isaku Yamahata <address@hidden>
---
hw/ide/ich.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/hw/ide/ich.c b/hw/ide/ich.c
index f242d7a..e190f24 100644
--- a/hw/ide/ich.c
+++ b/hw/ide/ich.c
@@ -92,8 +92,6 @@ static int pci_ich9_ahci_init(PCIDevice *dev)
/* XXX Software should program this register */
d->card.config[0x90] = 1 << 6; /* Address Map Register - AHCI mode */
- qemu_register_reset(ahci_reset, d);
-
/* XXX BAR size should be 1k, but that breaks, so bump it to 4k for now */
pci_register_bar(&d->card, 5, 0x1000, PCI_BASE_ADDRESS_SPACE_MEMORY,
ahci_pci_map);
@@ -115,7 +113,6 @@ static int pci_ich9_uninit(PCIDevice *dev)
msi_uninit(dev);
}
- qemu_unregister_reset(ahci_reset, d);
ahci_uninit(&d->ahci);
return 0;
@@ -128,11 +125,17 @@ static void pci_ich9_write_config(PCIDevice *pci,
uint32_t addr,
msi_write_config(pci, addr, val, len);
}
+static void pci_ich9_resetfn(DeviceState *qdev)
+{
+ ahci_reset(qdev);
+}
+
static PCIDeviceInfo ich_ahci_info[] = {
{
.qdev.name = "ich9-ahci",
.qdev.alias = "ahci",
.qdev.size = sizeof(AHCIPCIState),
+ .qdev.reset = pci_ich9_resetfn,
.init = pci_ich9_ahci_init,
.exit = pci_ich9_uninit,
.config_write = pci_ich9_write_config,
--
1.7.1.1
- [Qemu-devel] [PATCH 00/26] q35 chipset support for native pci express support, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 10/26] ide/ahci/ich: use qdev.reset,
Isaku Yamahata <=
- [Qemu-devel] [PATCH 06/26] pci_bridge: add helper function to convert PCIBridge into PCIDevice, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 25/26] pci_ids: add intel 82801BA pci-to-pci bridge id and PCI_CLASS_SERIAL_SMBUS, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 13/26] usb/uhci: add ich9 usb uhci id's device, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 01/26] pci: replace the magic, 256, for the maximum of slot, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 17/26] pc, pc_piix: split out pc nic initialization, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 16/26] pc, pc_piix: split out allocating isa irqs, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 14/26] ide: consolidate drive_get(IF_IDE), Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 11/26] ahci: add ide device initialization helper, Isaku Yamahata, 2011/03/16
- [Qemu-devel] [PATCH 18/26] ioapic: move ioapic_init() from pc_piix.c to pc.c, Isaku Yamahata, 2011/03/16