aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/irq/autoprobe.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-02-07 14:25:25 -0500
committerThomas Gleixner <tglx@linutronix.de>2011-02-19 06:58:15 -0500
commitbd062e7667ac173afef57fbfe9327f3b914a9d4c (patch)
tree29e798cb397311abec53ad45b73efdede1fc37b7 /kernel/irq/autoprobe.c
parente6bea9c404699223322d7411c6f2ceaec02fa83c (diff)
genirq: Move IRQ_AUTODETECT to internal state
No users outside of core Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/irq/autoprobe.c')
-rw-r--r--kernel/irq/autoprobe.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/kernel/irq/autoprobe.c b/kernel/irq/autoprobe.c
index 08947cb61725..916e56e10a2e 100644
--- a/kernel/irq/autoprobe.c
+++ b/kernel/irq/autoprobe.c
@@ -32,7 +32,6 @@ unsigned long probe_irq_on(void)
32{ 32{
33 struct irq_desc *desc; 33 struct irq_desc *desc;
34 unsigned long mask = 0; 34 unsigned long mask = 0;
35 unsigned int status;
36 int i; 35 int i;
37 36
38 /* 37 /*
@@ -76,7 +75,8 @@ unsigned long probe_irq_on(void)
76 for_each_irq_desc_reverse(i, desc) { 75 for_each_irq_desc_reverse(i, desc) {
77 raw_spin_lock_irq(&desc->lock); 76 raw_spin_lock_irq(&desc->lock);
78 if (!desc->action && !(desc->status & IRQ_NOPROBE)) { 77 if (!desc->action && !(desc->status & IRQ_NOPROBE)) {
79 desc->status |= IRQ_AUTODETECT | IRQ_WAITING; 78 desc->istate |= IRQS_AUTODETECT;
79 desc->status |= IRQ_WAITING;
80 if (irq_startup(desc)) 80 if (irq_startup(desc))
81 desc->status |= IRQ_PENDING; 81 desc->status |= IRQ_PENDING;
82 } 82 }
@@ -93,12 +93,11 @@ unsigned long probe_irq_on(void)
93 */ 93 */
94 for_each_irq_desc(i, desc) { 94 for_each_irq_desc(i, desc) {
95 raw_spin_lock_irq(&desc->lock); 95 raw_spin_lock_irq(&desc->lock);
96 status = desc->status;
97 96
98 if (status & IRQ_AUTODETECT) { 97 if (desc->istate & IRQS_AUTODETECT) {
99 /* It triggered already - consider it spurious. */ 98 /* It triggered already - consider it spurious. */
100 if (!(status & IRQ_WAITING)) { 99 if (!(desc->status & IRQ_WAITING)) {
101 desc->status = status & ~IRQ_AUTODETECT; 100 desc->istate &= ~IRQS_AUTODETECT;
102 irq_shutdown(desc); 101 irq_shutdown(desc);
103 } else 102 } else
104 if (i < 32) 103 if (i < 32)
@@ -125,19 +124,17 @@ EXPORT_SYMBOL(probe_irq_on);
125 */ 124 */
126unsigned int probe_irq_mask(unsigned long val) 125unsigned int probe_irq_mask(unsigned long val)
127{ 126{
128 unsigned int status, mask = 0; 127 unsigned int mask = 0;
129 struct irq_desc *desc; 128 struct irq_desc *desc;
130 int i; 129 int i;
131 130
132 for_each_irq_desc(i, desc) { 131 for_each_irq_desc(i, desc) {
133 raw_spin_lock_irq(&desc->lock); 132 raw_spin_lock_irq(&desc->lock);
134 status = desc->status; 133 if (desc->istate & IRQS_AUTODETECT) {
135 134 if (i < 16 && !(desc->status & IRQ_WAITING))
136 if (status & IRQ_AUTODETECT) {
137 if (i < 16 && !(status & IRQ_WAITING))
138 mask |= 1 << i; 135 mask |= 1 << i;
139 136
140 desc->status = status & ~IRQ_AUTODETECT; 137 desc->istate &= ~IRQS_AUTODETECT;
141 irq_shutdown(desc); 138 irq_shutdown(desc);
142 } 139 }
143 raw_spin_unlock_irq(&desc->lock); 140 raw_spin_unlock_irq(&desc->lock);
@@ -169,19 +166,17 @@ int probe_irq_off(unsigned long val)
169{ 166{
170 int i, irq_found = 0, nr_of_irqs = 0; 167 int i, irq_found = 0, nr_of_irqs = 0;
171 struct irq_desc *desc; 168 struct irq_desc *desc;
172 unsigned int status;
173 169
174 for_each_irq_desc(i, desc) { 170 for_each_irq_desc(i, desc) {
175 raw_spin_lock_irq(&desc->lock); 171 raw_spin_lock_irq(&desc->lock);
176 status = desc->status;
177 172
178 if (status & IRQ_AUTODETECT) { 173 if (desc->istate & IRQS_AUTODETECT) {
179 if (!(status & IRQ_WAITING)) { 174 if (!(desc->status & IRQ_WAITING)) {
180 if (!nr_of_irqs) 175 if (!nr_of_irqs)
181 irq_found = i; 176 irq_found = i;
182 nr_of_irqs++; 177 nr_of_irqs++;
183 } 178 }
184 desc->status = status & ~IRQ_AUTODETECT; 179 desc->istate &= ~IRQS_AUTODETECT;
185 irq_shutdown(desc); 180 irq_shutdown(desc);
186 } 181 }
187 raw_spin_unlock_irq(&desc->lock); 182 raw_spin_unlock_irq(&desc->lock);