[PATCH 04/18] hw/pci-host/bonito: Use pci_config_set_interrupt_pin()

Philippe Mathieu-Daudé posted 18 patches 4 years, 10 months ago
Maintainers: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, Aurelien Jarno <aurelien@aurel32.net>
[PATCH 04/18] hw/pci-host/bonito: Use pci_config_set_interrupt_pin()
Posted by Philippe Mathieu-Daudé 4 years, 10 months ago
Replace pci_set_byte(PCI_INTERRUPT_PIN) by
pci_config_set_interrupt_pin().

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/pci-host/bonito.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
index 4c903d4f682..fe94e6740b5 100644
--- a/hw/pci-host/bonito.c
+++ b/hw/pci-host/bonito.c
@@ -723,7 +723,8 @@ static void bonito_realize(PCIDevice *dev, Error **errp)
     pci_set_word(dev->config + PCI_SUBSYSTEM_ID, 0x0000);
 
     pci_set_byte(dev->config + PCI_INTERRUPT_LINE, 0x00);
-    pci_set_byte(dev->config + PCI_INTERRUPT_PIN, 0x01);
+    pci_config_set_interrupt_pin(dev->config, 0x01); /* interrupt pin A */
+
     pci_set_byte(dev->config + PCI_MIN_GNT, 0x3c);
     pci_set_byte(dev->config + PCI_MAX_LAT, 0x00);
 
-- 
2.26.2

Re: [PATCH 04/18] hw/pci-host/bonito: Use pci_config_set_interrupt_pin()
Posted by Huacai Chen 4 years, 10 months ago
Reviewed-by: Huacai Chen <chenhuacai@kernel.org>

On Fri, Jan 1, 2021 at 6:49 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> Replace pci_set_byte(PCI_INTERRUPT_PIN) by
> pci_config_set_interrupt_pin().
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/pci-host/bonito.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
> index 4c903d4f682..fe94e6740b5 100644
> --- a/hw/pci-host/bonito.c
> +++ b/hw/pci-host/bonito.c
> @@ -723,7 +723,8 @@ static void bonito_realize(PCIDevice *dev, Error **errp)
>      pci_set_word(dev->config + PCI_SUBSYSTEM_ID, 0x0000);
>
>      pci_set_byte(dev->config + PCI_INTERRUPT_LINE, 0x00);
> -    pci_set_byte(dev->config + PCI_INTERRUPT_PIN, 0x01);
> +    pci_config_set_interrupt_pin(dev->config, 0x01); /* interrupt pin A */
> +
>      pci_set_byte(dev->config + PCI_MIN_GNT, 0x3c);
>      pci_set_byte(dev->config + PCI_MAX_LAT, 0x00);
>
> --
> 2.26.2
>