[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 64/78] hw/isa/piix: Resolve duplicate code regarding PCI interr
From: |
Michael S. Tsirkin |
Subject: |
[PULL v2 64/78] hw/isa/piix: Resolve duplicate code regarding PCI interrupt wiring |
Date: |
Thu, 19 Oct 2023 14:24:02 -0400 |
From: Bernhard Beschow <shentey@gmail.com>
Now that both PIIX3 and PIIX4 use piix_set_irq() to trigger PCI IRQs the wiring
in the respective realize methods can be shared, too.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20231007123843.127151-28-shentey@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/isa/piix.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/hw/isa/piix.c b/hw/isa/piix.c
index 17677c2126..cba2098ca2 100644
--- a/hw/isa/piix.c
+++ b/hw/isa/piix.c
@@ -372,6 +372,8 @@ static void pci_piix_realize(PCIDevice *dev, const char
*uhci_type,
}
qdev_connect_gpio_out(DEVICE(&d->pm), 0, d->isa_irqs_in[9]);
}
+
+ pci_bus_irqs(pci_bus, piix_set_pci_irq, d, PIIX_NUM_PIRQS);
}
static void build_pci_isa_aml(AcpiDevAmlIf *adev, Aml *scope)
@@ -453,7 +455,6 @@ static const TypeInfo piix_pci_type_info = {
static void piix3_realize(PCIDevice *dev, Error **errp)
{
ERRP_GUARD();
- PIIXState *piix3 = PIIX_PCI_DEVICE(dev);
PCIBus *pci_bus = pci_get_bus(dev);
pci_piix_realize(dev, TYPE_PIIX3_USB_UHCI, errp);
@@ -461,7 +462,6 @@ static void piix3_realize(PCIDevice *dev, Error **errp)
return;
}
- pci_bus_irqs(pci_bus, piix_set_pci_irq, piix3, PIIX_NUM_PIRQS);
pci_bus_set_route_irq_fn(pci_bus, piix_route_intx_pin_to_irq);
}
@@ -492,16 +492,7 @@ static const TypeInfo piix3_info = {
static void piix4_realize(PCIDevice *dev, Error **errp)
{
- ERRP_GUARD();
- PIIXState *s = PIIX_PCI_DEVICE(dev);
- PCIBus *pci_bus = pci_get_bus(dev);
-
pci_piix_realize(dev, TYPE_PIIX4_USB_UHCI, errp);
- if (*errp) {
- return;
- }
-
- pci_bus_irqs(pci_bus, piix_set_pci_irq, s, PIIX_NUM_PIRQS);
}
static void piix4_init(Object *obj)
--
MST
- [PULL v2 78/78] intel-iommu: Report interrupt remapping faults, fix return value, (continued)
- [PULL v2 78/78] intel-iommu: Report interrupt remapping faults, fix return value, Michael S. Tsirkin, 2023/10/19
- [PULL v2 47/78] hw/i386/pc: Wire RTC ISA IRQs in south bridges, Michael S. Tsirkin, 2023/10/19
- [PULL v2 57/78] hw/isa/piix: Allow for optional PIC creation in PIIX3, Michael S. Tsirkin, 2023/10/19
- [PULL v2 61/78] hw/isa/piix: Reuse PIIX3 base class' realize method in PIIX4, Michael S. Tsirkin, 2023/10/19
- [PULL v2 58/78] hw/isa/piix: Allow for optional PIT creation in PIIX3, Michael S. Tsirkin, 2023/10/19
- [PULL v2 72/78] hw/i386/cxl: ensure maxram is greater than ram size for calculating cxl range, Michael S. Tsirkin, 2023/10/19
- [PULL v2 70/78] vhost-user-scsi: start vhost when guest kicks, Michael S. Tsirkin, 2023/10/19
- [PULL v2 18/78] tests: bios-tables-test: Prepare the ACPI table change for smbios type4 thread count test, Michael S. Tsirkin, 2023/10/19
- [PULL v2 29/78] vhost-user: allow "vhost_set_vring" to wait for a reply, Michael S. Tsirkin, 2023/10/19
- [PULL v2 24/78] vhost-user: strip superfluous whitespace, Michael S. Tsirkin, 2023/10/19
- [PULL v2 64/78] hw/isa/piix: Resolve duplicate code regarding PCI interrupt wiring,
Michael S. Tsirkin <=
- [PULL v2 68/78] vhost: move and rename the conn retry times, Michael S. Tsirkin, 2023/10/19
- [PULL v2 55/78] hw/isa/piix4: Reuse struct PIIXState from PIIX3, Michael S. Tsirkin, 2023/10/19
- [PULL v2 66/78] hw/i386/pc_piix: Make PIIX4 south bridge usable in PC machine, Michael S. Tsirkin, 2023/10/19
- [PULL v2 67/78] vhost-user-common: send get_inflight_fd once, Michael S. Tsirkin, 2023/10/19
- [PULL v2 75/78] tests/acpi: Update DSDT.cxl with QTG DSM, Michael S. Tsirkin, 2023/10/19
- [PULL v2 60/78] hw/isa/piix: Share PIIX3's base class with PIIX4, Michael S. Tsirkin, 2023/10/19
- [PULL v2 76/78] vhost-user: Fix protocol feature bit conflict, Michael S. Tsirkin, 2023/10/19
- [PULL v2 74/78] hw/cxl: Add QTG _DSM support for ACPI0017 device, Michael S. Tsirkin, 2023/10/19
- [PULL v2 44/78] hw/isa/piix3: Rename "pic" attribute to "isa_irqs_in", Michael S. Tsirkin, 2023/10/19
- [PULL v2 77/78] MAINTAINERS: Add include/hw/intc/i8259.h to the PC chip section, Michael S. Tsirkin, 2023/10/19