[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 14/18] hw/ide/piix: Use generic ide_bus_init_ioport()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 14/18] hw/ide/piix: Use generic ide_bus_init_ioport() |
Date: |
Wed, 15 Feb 2023 17:16:37 +0100 |
TYPE_PIIX3_IDE is a PCI function inheriting from QOM
TYPE_PCI_DEVICE. To be able to call the ISA specific
ide_init_ioport_isa(), we call this function passing
a NULL ISADevice argument. Remove this hack by calling
the recently added generic ide_init_ioport(), which
doesn't expect any ISADevice.
Inspired-by: Bernhard Beschow <shentey@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/ide/piix.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index 9b886fc0d2..74e2f4288d 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -138,7 +138,6 @@ static bool pci_piix_init_bus(PCIIDEState *d, unsigned i,
Error **errp)
{0x1f0, 0x3f6},
{0x170, 0x376},
};
- int ret;
if (!d->irq[i]) {
error_setg(errp, "output IDE IRQ %u not connected", i);
@@ -146,13 +145,9 @@ static bool pci_piix_init_bus(PCIIDEState *d, unsigned i,
Error **errp)
}
ide_bus_init(&d->bus[i], sizeof(d->bus[i]), DEVICE(d), i, 2);
- ret = ide_bus_init_ioport_isa(&d->bus[i], NULL,
- port_info[i].iobase, port_info[i].iobase2);
- if (ret) {
- error_setg_errno(errp, -ret, "Failed to realize %s port %u",
- object_get_typename(OBJECT(d)), i);
- return false;
- }
+ ide_bus_init_ioport(&d->bus[i], OBJECT(d),
+ pci_address_space_io(PCI_DEVICE(d)),
+ port_info[i].iobase, port_info[i].iobase2);
ide_bus_init_output_irq(&d->bus[i], d->irq[i]);
bmdma_init(&d->bus[i], &d->bmdma[i], d);
--
2.38.1
[PATCH v2 08/18] hw/isa: Deprecate isa_get_irq() in favor of isa_bus_get_irq(), Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 09/18] hw/isa: Simplify isa_address_space[_io](), Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 10/18] hw/isa: Use isa_address_space_io() in isa_register_ioport(), Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 11/18] hw/ide: Declare ide_get_[geometry/bios_chs_trans] in 'hw/ide/internal.h', Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 12/18] hw/ide: Rename ISA specific ide_init_ioport -> ide_bus_init_ioport_isa, Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 15/18] hw/isa: Ensure isa_register_portio_list() do not get NULL ISA device, Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 13/18] hw/ide: Introduce generic ide_init_ioport(), Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 14/18] hw/ide/piix: Use generic ide_bus_init_ioport(),
Philippe Mathieu-Daudé <=
[PATCH v2 16/18] hw/isa: Reduce 'isabus' singleton scope to isa_bus_new(), Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 17/18] hw/isa: Un-inline isa_bus_from_device(), Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 18/18] hw/isa: Remove empty ISADeviceClass structure, Philippe Mathieu-Daudé, 2023/02/15
[PATCH v2 06.5/18] hw/ide/piix: Allow using PIIX3-IDE as standalone PCI function, Philippe Mathieu-Daudé, 2023/02/20