@@ -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)