linux-mips
[Top] [All Lists]

[PATCH 1/4] MIPS: ath79: allow to specify bus number in PCI IRQ maps

To: Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH 1/4] MIPS: ath79: allow to specify bus number in PCI IRQ maps
From: Gabor Juhos <juhosg@openwrt.org>
Date: Sun, 3 Feb 2013 11:58:37 +0100
Cc: linux-mips <linux-mips@linux-mips.org>, John Crispin <blogic@openwrt.org>, Gabor Juhos <juhosg@openwrt.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Sender: linux-mips-bounce@linux-mips.org
This is needed for multiple PCI bus support.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
 arch/mips/ath79/pci.c |    4 +++-
 arch/mips/ath79/pci.h |    1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/mips/ath79/pci.c b/arch/mips/ath79/pci.c
index c94bcec..d90e071 100644
--- a/arch/mips/ath79/pci.c
+++ b/arch/mips/ath79/pci.c
@@ -75,7 +75,9 @@ int __init pcibios_map_irq(const struct pci_dev *dev, uint8_t 
slot, uint8_t pin)
                const struct ath79_pci_irq *entry;
 
                entry = &ath79_pci_irq_map[i];
-               if (entry->slot == slot && entry->pin == pin) {
+               if (entry->bus == dev->bus->number &&
+                   entry->slot == slot &&
+                   entry->pin == pin) {
                        irq = entry->irq;
                        break;
                }
diff --git a/arch/mips/ath79/pci.h b/arch/mips/ath79/pci.h
index 51c6625..1d00a38 100644
--- a/arch/mips/ath79/pci.h
+++ b/arch/mips/ath79/pci.h
@@ -14,6 +14,7 @@
 #define _ATH79_PCI_H
 
 struct ath79_pci_irq {
+       int     bus;
        u8      slot;
        u8      pin;
        int     irq;
-- 
1.7.10


<Prev in Thread] Current Thread [Next in Thread>