diff options
| author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2024-02-13 08:31:45 +0100 |
|---|---|---|
| committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2024-02-15 16:58:46 +0100 |
| commit | e6097f186416df368a7f87a37f0a7fd25de587ba (patch) | |
| tree | 549924fa2ed0c04c1db0084c754a873b23cf880d /hw/i386/pc_q35.c | |
| parent | 41c05b41e3b3c5b6b167c315d0f25eb355dcc326 (diff) | |
| download | focaccia-qemu-e6097f186416df368a7f87a37f0a7fd25de587ba.tar.gz focaccia-qemu-e6097f186416df368a7f87a37f0a7fd25de587ba.zip | |
hw/ide/ahci: Inline ahci_get_num_ports()
Introduce the 'ich9' variable and inline ahci_get_num_ports(). Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20240213081201.78951-5-philmd@linaro.org>
Diffstat (limited to 'hw/i386/pc_q35.c')
| -rw-r--r-- | hw/i386/pc_q35.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index a89f900c4c..09e12418f9 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -292,16 +292,18 @@ static void pc_q35_init(MachineState *machine) if (pcms->sata_enabled) { PCIDevice *pdev; + AHCIPCIState *ich9; /* ahci and SATA device, for q35 1 ahci controller is built-in */ pdev = pci_create_simple_multifunction(host_bus, PCI_DEVFN(ICH9_SATA1_DEV, ICH9_SATA1_FUNC), "ich9-ahci"); + ich9 = ICH9_AHCI(pdev); idebus[0] = qdev_get_child_bus(DEVICE(pdev), "ide.0"); idebus[1] = qdev_get_child_bus(DEVICE(pdev), "ide.1"); - g_assert(MAX_SATA_PORTS == ahci_get_num_ports(pdev)); - ide_drive_get(hd, ahci_get_num_ports(pdev)); + g_assert(MAX_SATA_PORTS == ich9->ahci.ports); + ide_drive_get(hd, ich9->ahci.ports); ahci_ide_create_devs(pdev, hd); } else { idebus[0] = idebus[1] = NULL; |