@@ -975,10 +975,6 @@ static int octeon_irq_ciu_xlat(struct irq_domain *d,
975
975
if (ciu > 1 || bit > 63 )
976
976
return - EINVAL ;
977
977
978
- /* These are the GPIO lines */
979
- if (ciu == 0 && bit >= 16 && bit < 32 )
980
- return - EINVAL ;
981
-
982
978
* out_hwirq = (ciu << 6 ) | bit ;
983
979
* out_type = 0 ;
984
980
@@ -1007,6 +1003,10 @@ static int octeon_irq_ciu_map(struct irq_domain *d,
1007
1003
if (!octeon_irq_virq_in_range (virq ))
1008
1004
return - EINVAL ;
1009
1005
1006
+ /* Don't map irq if it is reserved for GPIO. */
1007
+ if (line == 0 && bit >= 16 && bit < 32 )
1008
+ return 0 ;
1009
+
1010
1010
if (line > 1 || octeon_irq_ciu_to_irq [line ][bit ] != 0 )
1011
1011
return - EINVAL ;
1012
1012
@@ -1525,10 +1525,6 @@ static int octeon_irq_ciu2_xlat(struct irq_domain *d,
1525
1525
ciu = intspec [0 ];
1526
1526
bit = intspec [1 ];
1527
1527
1528
- /* Line 7 are the GPIO lines */
1529
- if (ciu > 6 || bit > 63 )
1530
- return - EINVAL ;
1531
-
1532
1528
* out_hwirq = (ciu << 6 ) | bit ;
1533
1529
* out_type = 0 ;
1534
1530
@@ -1570,8 +1566,14 @@ static int octeon_irq_ciu2_map(struct irq_domain *d,
1570
1566
if (!octeon_irq_virq_in_range (virq ))
1571
1567
return - EINVAL ;
1572
1568
1573
- /* Line 7 are the GPIO lines */
1574
- if (line > 6 || octeon_irq_ciu_to_irq [line ][bit ] != 0 )
1569
+ /*
1570
+ * Don't map irq if it is reserved for GPIO.
1571
+ * (Line 7 are the GPIO lines.)
1572
+ */
1573
+ if (line == 7 )
1574
+ return 0 ;
1575
+
1576
+ if (line > 7 || octeon_irq_ciu_to_irq [line ][bit ] != 0 )
1575
1577
return - EINVAL ;
1576
1578
1577
1579
if (octeon_irq_ciu2_is_edge (line , bit ))
0 commit comments