diff options
-rw-r--r-- | arch/mips/lantiq/irq.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/arch/mips/lantiq/irq.c b/arch/mips/lantiq/irq.c index ff17669e30a3..bb1c39e0ce4d 100644 --- a/arch/mips/lantiq/irq.c +++ b/arch/mips/lantiq/irq.c | |||
@@ -66,7 +66,7 @@ int gic_present; | |||
66 | #endif | 66 | #endif |
67 | 67 | ||
68 | static int exin_avail; | 68 | static int exin_avail; |
69 | static struct resource ltq_eiu_irq[MAX_EIU]; | 69 | static u32 ltq_eiu_irq[MAX_EIU]; |
70 | static void __iomem *ltq_icu_membase[MAX_IM]; | 70 | static void __iomem *ltq_icu_membase[MAX_IM]; |
71 | static void __iomem *ltq_eiu_membase; | 71 | static void __iomem *ltq_eiu_membase; |
72 | static struct irq_domain *ltq_domain; | 72 | static struct irq_domain *ltq_domain; |
@@ -75,7 +75,7 @@ static int ltq_perfcount_irq; | |||
75 | int ltq_eiu_get_irq(int exin) | 75 | int ltq_eiu_get_irq(int exin) |
76 | { | 76 | { |
77 | if (exin < exin_avail) | 77 | if (exin < exin_avail) |
78 | return ltq_eiu_irq[exin].start; | 78 | return ltq_eiu_irq[exin]; |
79 | return -1; | 79 | return -1; |
80 | } | 80 | } |
81 | 81 | ||
@@ -126,7 +126,7 @@ static int ltq_eiu_settype(struct irq_data *d, unsigned int type) | |||
126 | int i; | 126 | int i; |
127 | 127 | ||
128 | for (i = 0; i < MAX_EIU; i++) { | 128 | for (i = 0; i < MAX_EIU; i++) { |
129 | if (d->hwirq == ltq_eiu_irq[i].start) { | 129 | if (d->hwirq == ltq_eiu_irq[i]) { |
130 | int val = 0; | 130 | int val = 0; |
131 | int edge = 0; | 131 | int edge = 0; |
132 | 132 | ||
@@ -174,7 +174,7 @@ static unsigned int ltq_startup_eiu_irq(struct irq_data *d) | |||
174 | 174 | ||
175 | ltq_enable_irq(d); | 175 | ltq_enable_irq(d); |
176 | for (i = 0; i < MAX_EIU; i++) { | 176 | for (i = 0; i < MAX_EIU; i++) { |
177 | if (d->hwirq == ltq_eiu_irq[i].start) { | 177 | if (d->hwirq == ltq_eiu_irq[i]) { |
178 | /* by default we are low level triggered */ | 178 | /* by default we are low level triggered */ |
179 | ltq_eiu_settype(d, IRQF_TRIGGER_LOW); | 179 | ltq_eiu_settype(d, IRQF_TRIGGER_LOW); |
180 | /* clear all pending */ | 180 | /* clear all pending */ |
@@ -196,7 +196,7 @@ static void ltq_shutdown_eiu_irq(struct irq_data *d) | |||
196 | 196 | ||
197 | ltq_disable_irq(d); | 197 | ltq_disable_irq(d); |
198 | for (i = 0; i < MAX_EIU; i++) { | 198 | for (i = 0; i < MAX_EIU; i++) { |
199 | if (d->hwirq == ltq_eiu_irq[i].start) { | 199 | if (d->hwirq == ltq_eiu_irq[i]) { |
200 | /* disable */ | 200 | /* disable */ |
201 | ltq_eiu_w32(ltq_eiu_r32(LTQ_EIU_EXIN_INEN) & ~BIT(i), | 201 | ltq_eiu_w32(ltq_eiu_r32(LTQ_EIU_EXIN_INEN) & ~BIT(i), |
202 | LTQ_EIU_EXIN_INEN); | 202 | LTQ_EIU_EXIN_INEN); |
@@ -341,7 +341,7 @@ static int icu_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw) | |||
341 | return 0; | 341 | return 0; |
342 | 342 | ||
343 | for (i = 0; i < exin_avail; i++) | 343 | for (i = 0; i < exin_avail; i++) |
344 | if (hw == ltq_eiu_irq[i].start) | 344 | if (hw == ltq_eiu_irq[i]) |
345 | chip = <q_eiu_type; | 345 | chip = <q_eiu_type; |
346 | 346 | ||
347 | irq_set_chip_and_handler(hw, chip, handle_level_irq); | 347 | irq_set_chip_and_handler(hw, chip, handle_level_irq); |
@@ -439,14 +439,15 @@ int __init icu_of_init(struct device_node *node, struct device_node *parent) | |||
439 | eiu_node = of_find_compatible_node(NULL, NULL, "lantiq,eiu-xway"); | 439 | eiu_node = of_find_compatible_node(NULL, NULL, "lantiq,eiu-xway"); |
440 | if (eiu_node && !of_address_to_resource(eiu_node, 0, &res)) { | 440 | if (eiu_node && !of_address_to_resource(eiu_node, 0, &res)) { |
441 | /* find out how many external irq sources we have */ | 441 | /* find out how many external irq sources we have */ |
442 | exin_avail = of_irq_count(eiu_node); | 442 | exin_avail = of_property_count_u32_elems(eiu_node, |
443 | "lantiq,eiu-irqs"); | ||
443 | 444 | ||
444 | if (exin_avail > MAX_EIU) | 445 | if (exin_avail > MAX_EIU) |
445 | exin_avail = MAX_EIU; | 446 | exin_avail = MAX_EIU; |
446 | 447 | ||
447 | ret = of_irq_to_resource_table(eiu_node, | 448 | ret = of_property_read_u32_array(eiu_node, "lantiq,eiu-irqs", |
448 | ltq_eiu_irq, exin_avail); | 449 | ltq_eiu_irq, exin_avail); |
449 | if (ret != exin_avail) | 450 | if (ret) |
450 | panic("failed to load external irq resources"); | 451 | panic("failed to load external irq resources"); |
451 | 452 | ||
452 | if (!request_mem_region(res.start, resource_size(&res), | 453 | if (!request_mem_region(res.start, resource_size(&res), |