0047-irq-fixes.patch 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. --- a/arch/mips/lantiq/irq.c
  2. +++ b/arch/mips/lantiq/irq.c
  3. @@ -67,7 +67,7 @@ int gic_present;
  4. #endif
  5. static int exin_avail;
  6. -static struct resource ltq_eiu_irq[MAX_EIU];
  7. +static u32 ltq_eiu_irq[MAX_EIU];
  8. static void __iomem *ltq_icu_membase[MAX_IM];
  9. static void __iomem *ltq_eiu_membase;
  10. static struct irq_domain *ltq_domain;
  11. @@ -76,7 +76,7 @@ static int ltq_perfcount_irq;
  12. int ltq_eiu_get_irq(int exin)
  13. {
  14. if (exin < exin_avail)
  15. - return ltq_eiu_irq[exin].start;
  16. + return ltq_eiu_irq[exin];
  17. return -1;
  18. }
  19. @@ -128,7 +128,7 @@ static int ltq_eiu_settype(struct irq_da
  20. int i;
  21. for (i = 0; i < MAX_EIU; i++) {
  22. - if (d->hwirq == ltq_eiu_irq[i].start) {
  23. + if (d->hwirq == ltq_eiu_irq[i]) {
  24. int val = 0;
  25. int edge = 0;
  26. @@ -177,7 +177,7 @@ static unsigned int ltq_startup_eiu_irq(
  27. ltq_enable_irq(d);
  28. for (i = 0; i < MAX_EIU; i++) {
  29. - if (d->hwirq == ltq_eiu_irq[i].start) {
  30. + if (d->hwirq == ltq_eiu_irq[i]) {
  31. /* by default we are low level triggered */
  32. ltq_eiu_settype(d, IRQF_TRIGGER_LOW);
  33. /* clear all pending */
  34. @@ -199,7 +199,7 @@ static void ltq_shutdown_eiu_irq(struct
  35. ltq_disable_irq(d);
  36. for (i = 0; i < MAX_EIU; i++) {
  37. - if (d->hwirq == ltq_eiu_irq[i].start) {
  38. + if (d->hwirq == ltq_eiu_irq[i]) {
  39. /* disable */
  40. ltq_eiu_w32(ltq_eiu_r32(LTQ_EIU_EXIN_INEN) & ~BIT(i),
  41. LTQ_EIU_EXIN_INEN);
  42. @@ -344,10 +344,10 @@ static int icu_map(struct irq_domain *d,
  43. return 0;
  44. for (i = 0; i < exin_avail; i++)
  45. - if (hw == ltq_eiu_irq[i].start)
  46. + if (hw == ltq_eiu_irq[i])
  47. chip = &ltq_eiu_type;
  48. - irq_set_chip_and_handler(hw, chip, handle_level_irq);
  49. + irq_set_chip_and_handler(irq, chip, handle_level_irq);
  50. return 0;
  51. }
  52. @@ -442,14 +442,14 @@ int __init icu_of_init(struct device_nod
  53. eiu_node = of_find_compatible_node(NULL, NULL, "lantiq,eiu-xway");
  54. if (eiu_node && !of_address_to_resource(eiu_node, 0, &res)) {
  55. /* find out how many external irq sources we have */
  56. - exin_avail = of_irq_count(eiu_node);
  57. + exin_avail = of_property_count_u32_elems(eiu_node, "lantiq,eiu-irqs");
  58. if (exin_avail > MAX_EIU)
  59. exin_avail = MAX_EIU;
  60. - ret = of_irq_to_resource_table(eiu_node,
  61. + ret = of_property_read_u32_array(eiu_node, "lantiq,eiu-irqs",
  62. ltq_eiu_irq, exin_avail);
  63. - if (ret != exin_avail)
  64. + if (ret)
  65. panic("failed to load external irq resources");
  66. if (!request_mem_region(res.start, resource_size(&res),