ixp4xx: replace magic number with macros in avila/ixdp425/miccpt PCI routing setup
Replace magic number with the appropriate macro in avila/ixdp425/miccpt PCI routing setup. Signed-off-by: Tamas TEVESZ <ice@extreme.hu> Signed-off-by: Jonas Gorski <jogo@openwrt.org> SVN-Revision: 37154
This commit is contained in:
parent
cdd6c5b750
commit
fb81a9b5ed
|
@ -11,17 +11,19 @@
|
||||||
#define IRQ_LINES 4
|
#define IRQ_LINES 4
|
||||||
|
|
||||||
/* PCI controller GPIO to IRQ pin mappings */
|
/* PCI controller GPIO to IRQ pin mappings */
|
||||||
@@ -55,9 +55,7 @@ static int __init avila_map_irq(const st
|
@@ -55,10 +55,8 @@ static int __init avila_map_irq(const st
|
||||||
IXP4XX_GPIO_IRQ(INTD)
|
IXP4XX_GPIO_IRQ(INTD)
|
||||||
};
|
};
|
||||||
|
|
||||||
- if (slot >= 1 &&
|
- if (slot >= 1 &&
|
||||||
- slot <= (machine_is_loft() ? LOFT_MAX_DEV : AVILA_MAX_DEV) &&
|
- slot <= (machine_is_loft() ? LOFT_MAX_DEV : AVILA_MAX_DEV) &&
|
||||||
- pin >= 1 && pin <= IRQ_LINES)
|
- pin >= 1 && pin <= IRQ_LINES)
|
||||||
|
- return pci_irq_table[(slot + pin - 2) % 4];
|
||||||
+ if (slot >= 1 && slot <= AVILA_MAX_DEV && pin >= 1 && pin <= IRQ_LINES)
|
+ if (slot >= 1 && slot <= AVILA_MAX_DEV && pin >= 1 && pin <= IRQ_LINES)
|
||||||
return pci_irq_table[(slot + pin - 2) % 4];
|
+ return pci_irq_table[(slot + pin - 2) % IRQ_LINES];
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
--- a/arch/arm/mach-ixp4xx/avila-setup.c
|
--- a/arch/arm/mach-ixp4xx/avila-setup.c
|
||||||
+++ b/arch/arm/mach-ixp4xx/avila-setup.c
|
+++ b/arch/arm/mach-ixp4xx/avila-setup.c
|
||||||
@@ -14,9 +14,16 @@
|
@@ -14,9 +14,16 @@
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
--- a/arch/arm/mach-ixp4xx/ixdp425-pci.c
|
||||||
|
+++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c
|
||||||
|
@@ -53,7 +53,7 @@ static int __init ixdp425_map_irq(const
|
||||||
|
};
|
||||||
|
|
||||||
|
if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES)
|
||||||
|
- return pci_irq_table[(slot + pin - 2) % 4];
|
||||||
|
+ return pci_irq_table[(slot + pin - 2) % IRQ_LINES];
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
--- a/arch/arm/mach-ixp4xx/miccpt-pci.c
|
||||||
|
+++ b/arch/arm/mach-ixp4xx/miccpt-pci.c
|
||||||
|
@@ -54,7 +54,7 @@ static int __init miccpt_map_irq(const s
|
||||||
|
};
|
||||||
|
|
||||||
|
if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES)
|
||||||
|
- return pci_irq_table[(slot + pin - 2) % 4];
|
||||||
|
+ return pci_irq_table[(slot + pin - 2) % IRQ_LINES];
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user