diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2024-02-25 18:03:15 +0100 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2024-02-27 09:37:30 +0100 |
commit | 72c9d94541bc6984bf29b6cee0a05b065e6c115e (patch) | |
tree | 626c74c7f0c6dde86ba07b0a7c4ba205207cb4bf /hw/arm | |
parent | 99e1c1137b6f339be1e4b76e243ad7b7c3d3cb8c (diff) | |
download | qemu-72c9d94541bc6984bf29b6cee0a05b065e6c115e.zip qemu-72c9d94541bc6984bf29b6cee0a05b065e6c115e.tar.gz qemu-72c9d94541bc6984bf29b6cee0a05b065e6c115e.tar.bz2 |
hw/arm/sbsa-ref: Do not open-code ahci_ide_create_devs()
Use ahci_ide_create_devs() instead of open-coding it.
Not accessing AHCIDevice internals anymore allows to
remove "hw/ide/ahci_internal.h" (which isn't really a
public header).
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20240226080632.9596-2-philmd@linaro.org>
Diffstat (limited to 'hw/arm')
-rw-r--r-- | hw/arm/sbsa-ref.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c index 5d3a574..4a59e2f 100644 --- a/hw/arm/sbsa-ref.c +++ b/hw/arm/sbsa-ref.c @@ -37,7 +37,6 @@ #include "hw/block/flash.h" #include "hw/boards.h" #include "hw/ide/internal.h" -#include "hw/ide/ahci_internal.h" #include "hw/ide/ahci-sysbus.h" #include "hw/intc/arm_gicv3_common.h" #include "hw/intc/arm_gicv3_its_common.h" @@ -571,8 +570,6 @@ static void create_ahci(const SBSAMachineState *sms) DeviceState *dev; DriveInfo *hd[NUM_SATA_PORTS]; SysbusAHCIState *sysahci; - AHCIState *ahci; - int i; dev = qdev_new("sysbus-ahci"); qdev_prop_set_uint32(dev, "num-ports", NUM_SATA_PORTS); @@ -581,14 +578,8 @@ static void create_ahci(const SBSAMachineState *sms) sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, qdev_get_gpio_in(sms->gic, irq)); sysahci = SYSBUS_AHCI(dev); - ahci = &sysahci->ahci; ide_drive_get(hd, ARRAY_SIZE(hd)); - for (i = 0; i < ahci->ports; i++) { - if (hd[i] == NULL) { - continue; - } - ide_bus_create_drive(&ahci->dev[i].port, 0, hd[i]); - } + ahci_ide_create_devs(&sysahci->ahci, hd); } static void create_xhci(const SBSAMachineState *sms) |