[PATCH-for-6.1] hw/isa/piix4: Use qdev_get_gpio_in_named() to get ISA IRQ

Philippe Mathieu-Daudé posted 1 patch 3 years ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210324182902.692419-1-f4bug@amsat.org
hw/isa/piix4.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
[PATCH-for-6.1] hw/isa/piix4: Use qdev_get_gpio_in_named() to get ISA IRQ
Posted by Philippe Mathieu-Daudé 3 years ago
Since commit 078778c5a55 ("piix4: Add an i8259 Interrupt Controller")
the TYPE_PIIX4_PCI_DEVICE exposes the ISA input IRQs as "isa" alias.

Use this alias to get IRQ for the power management PCI function.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/isa/piix4.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c
index a50d97834c7..33b94e4511f 100644
--- a/hw/isa/piix4.c
+++ b/hw/isa/piix4.c
@@ -255,8 +255,9 @@ DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbus)
     pci_create_simple(pci_bus, devfn + 2, "piix4-usb-uhci");
     if (smbus) {
         *smbus = piix4_pm_init(pci_bus, devfn + 3, 0x1100,
-                               isa_get_irq(NULL, 9), NULL, 0, NULL);
-   }
+                               qdev_get_gpio_in_named(dev, "isa", 9),
+                               NULL, 0, NULL);
+    }
 
     return dev;
 }
-- 
2.26.2

Re: [PATCH-for-6.1] hw/isa/piix4: Use qdev_get_gpio_in_named() to get ISA IRQ
Posted by Richard Henderson 3 years ago
On 3/24/21 12:29 PM, Philippe Mathieu-Daudé wrote:
> Since commit 078778c5a55 ("piix4: Add an i8259 Interrupt Controller")
> the TYPE_PIIX4_PCI_DEVICE exposes the ISA input IRQs as "isa" alias.
> 
> Use this alias to get IRQ for the power management PCI function.
> 
> Signed-off-by: Philippe Mathieu-Daudé<f4bug@amsat.org>
> ---
>   hw/isa/piix4.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~

Re: [PATCH-for-6.1] hw/isa/piix4: Use qdev_get_gpio_in_named() to get ISA IRQ
Posted by Philippe Mathieu-Daudé 3 years ago
On 3/24/21 7:29 PM, Philippe Mathieu-Daudé wrote:
> Since commit 078778c5a55 ("piix4: Add an i8259 Interrupt Controller")
> the TYPE_PIIX4_PCI_DEVICE exposes the ISA input IRQs as "isa" alias.
> 
> Use this alias to get IRQ for the power management PCI function.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/isa/piix4.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Thanks, applied to mips-next.