summaryrefslogtreecommitdiffstats
path: root/target/linux/adm5120/patches-3.3/a01-adm5120-core-build-error-fixes.patch
blob: bf0022da77b0e6ab089538a2f2b97d2438d23314 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
--- a/arch/mips/adm5120/common/platform.c
+++ b/arch/mips/adm5120/common/platform.c
@@ -18,6 +18,7 @@
 #include <linux/gpio.h>
 #include <linux/irq.h>
 #include <linux/slab.h>
+#include <linux/export.h>
 
 #include <asm/bootinfo.h>
 
--- a/arch/mips/adm5120/common/clock.c
+++ b/arch/mips/adm5120/common/clock.c
@@ -33,7 +33,7 @@ static struct clk uart_clk = {
 
 struct clk *clk_get(struct device *dev, const char *id)
 {
-	char *name = dev_name(dev);
+	const char *name = dev_name(dev);
 
 	if (!strcmp(name, "apb:uart0") || !strcmp(name, "apb:uart1"))
 		return &uart_clk;
--- a/arch/mips/pci/pci-adm5120.c
+++ b/arch/mips/pci/pci-adm5120.c
@@ -49,7 +49,7 @@
 static unsigned int adm5120_pci_nr_irqs __initdata;
 static struct adm5120_pci_irq *adm5120_pci_irq_map __initdata;
 
-static spinlock_t pci_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(pci_lock);
 
 /* -------------------------------------------------------------------------*/
 
--- a/arch/mips/adm5120/common/irq.c
+++ b/arch/mips/adm5120/common/irq.c
@@ -23,9 +23,9 @@
 
 #include <asm/mach-adm5120/adm5120_defs.h>
 
-static void adm5120_intc_irq_unmask(unsigned int irq);
-static void adm5120_intc_irq_mask(unsigned int irq);
-static int  adm5120_intc_irq_set_type(unsigned int irq, unsigned int flow_type);
+static void adm5120_intc_irq_unmask(struct irq_data *d);
+static void adm5120_intc_irq_mask(struct irq_data *d);
+static int  adm5120_intc_irq_set_type(struct irq_data *d, unsigned int flow_type);
 
 static inline void intc_write_reg(unsigned int reg, u32 val)
 {
@@ -43,10 +43,10 @@ static inline u32 intc_read_reg(unsigned
 
 static struct irq_chip adm5120_intc_irq_chip = {
 	.name		= "INTC",
-	.unmask		= adm5120_intc_irq_unmask,
-	.mask		= adm5120_intc_irq_mask,
-	.mask_ack	= adm5120_intc_irq_mask,
-	.set_type	= adm5120_intc_irq_set_type
+	.irq_unmask	= adm5120_intc_irq_unmask,
+	.irq_mask	= adm5120_intc_irq_mask,
+	.irq_mask_ack	= adm5120_intc_irq_mask,
+	.irq_set_type	= adm5120_intc_irq_set_type
 };
 
 static struct irqaction adm5120_intc_irq_action = {
@@ -54,20 +54,19 @@ static struct irqaction adm5120_intc_irq
 	.name		= "cascade [INTC]"
 };
 
-static void adm5120_intc_irq_unmask(unsigned int irq)
+static void adm5120_intc_irq_unmask(struct irq_data *d)
 {
-	irq -= ADM5120_INTC_IRQ_BASE;
-	intc_write_reg(INTC_REG_IRQ_ENABLE, 1 << irq);
+	intc_write_reg(INTC_REG_IRQ_ENABLE, 1 << (d->irq - ADM5120_INTC_IRQ_BASE));
 }
 
-static void adm5120_intc_irq_mask(unsigned int irq)
+static void adm5120_intc_irq_mask(struct irq_data *d)
 {
-	irq -= ADM5120_INTC_IRQ_BASE;
-	intc_write_reg(INTC_REG_IRQ_DISABLE, 1 << irq);
+	intc_write_reg(INTC_REG_IRQ_DISABLE, 1 << (d->irq - ADM5120_INTC_IRQ_BASE));
 }
 
-static int adm5120_intc_irq_set_type(unsigned int irq, unsigned int flow_type)
+static int adm5120_intc_irq_set_type(struct irq_data *d, unsigned int flow_type)
 {
+	unsigned int irq = d->irq;
 	unsigned int sense;
 	unsigned long mode;
 	int err = 0;
@@ -105,10 +104,6 @@ static int adm5120_intc_irq_set_type(uns
 			mode &= ~(1 << (irq - ADM5120_INTC_IRQ_BASE));
 
 		intc_write_reg(INTC_REG_INT_MODE, mode);
-		/* fallthrough */
-	default:
-		irq_desc[irq].status &= ~IRQ_TYPE_SENSE_MASK;
-		irq_desc[irq].status |= sense;
 		break;
 	}
 
@@ -162,8 +157,7 @@ static void __init adm5120_intc_irq_init
 	for (i = ADM5120_INTC_IRQ_BASE;
 		i <= ADM5120_INTC_IRQ_BASE + INTC_IRQ_LAST;
 		i++) {
-		irq_desc[i].status = INTC_IRQ_STATUS;
-		set_irq_chip_and_handler(i, &adm5120_intc_irq_chip,
+		irq_set_chip_and_handler(i, &adm5120_intc_irq_chip,
 			handle_level_irq);
 	}