[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 28/30] hw/arm/sbsa-ref: Do not open-code ahci_ide_create_devs()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 28/30] hw/arm/sbsa-ref: Do not open-code ahci_ide_create_devs() |
Date: |
Tue, 27 Feb 2024 09:39:44 +0100 |
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>
---
hw/arm/sbsa-ref.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
index 5d3a574664..4a59e2fd37 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)
--
2.41.0
- [PULL 17/30] hw/usb: remove usb_bus_find, (continued)
- [PULL 17/30] hw/usb: remove usb_bus_find, Philippe Mathieu-Daudé, 2024/02/27
- [PULL 19/30] hw/usb: remove duplicate file in system_ss, Philippe Mathieu-Daudé, 2024/02/27
- [PULL 20/30] hw/nvme: fix invalid endian conversion, Philippe Mathieu-Daudé, 2024/02/27
- [PULL 21/30] hw/i386/x86: Let ioapic_init_gsi() take parent as pointer, Philippe Mathieu-Daudé, 2024/02/27
- [PULL 22/30] hw/i386/sgx: Use QDev API, Philippe Mathieu-Daudé, 2024/02/27
- [PULL 23/30] hw/i386/q35: Include missing 'hw/acpi/acpi.h' header, Philippe Mathieu-Daudé, 2024/02/27
- [PULL 24/30] hw/i386/pc: Rename "bus" attribute to "pcibus", Philippe Mathieu-Daudé, 2024/02/27
- [PULL 25/30] hw/i386/pc_{piix, q35}: Eliminate local pci_bus/pci_host variables, Philippe Mathieu-Daudé, 2024/02/27
- [PULL 26/30] hw/i386/pc: Remove unneeded class attribute "kvmclock_enabled", Philippe Mathieu-Daudé, 2024/02/27
- [PULL 27/30] hw/i386/pc: Populate RTC attribute directly, Philippe Mathieu-Daudé, 2024/02/27
- [PULL 28/30] hw/arm/sbsa-ref: Do not open-code ahci_ide_create_devs(),
Philippe Mathieu-Daudé <=
- [PULL 29/30] hw/ide: Remove last two uses of ide/internal.h outside of hw/ide/, Philippe Mathieu-Daudé, 2024/02/27
- [PULL 30/30] hw/ide: Include 'ide-internal.h' from current path, Philippe Mathieu-Daudé, 2024/02/27
- [PULL 07/30] hw/nubus-device: round Declaration ROM memory region address to qemu_target_page_size(), Philippe Mathieu-Daudé, 2024/02/27
- Re: [PULL 00/30] Misc HW patches for 2024-02-27, Peter Maydell, 2024/02/27