diff options
author | Jiang Liu <jiang.liu@linux.intel.com> | 2015-06-01 04:05:17 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2015-07-31 16:20:05 -0400 |
commit | 6a4a5b34c315be04abdc366cda7a00b7249550f3 (patch) | |
tree | eaa8483c718482008c597618d20680a8370239d5 | |
parent | d2109a12198edf22eb85e475c223eea14b9c3fbe (diff) |
sparc/irq: Use helper irq_data_get_irq_handler_data()
Use helper function irq_data_get_irq_handler_data() to hide irq_desc
implementation details. This allows to move irq_data->handler_data to
irq_data_common, once all usage sites are converted.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Cc: David S. Miller <davem@davemloft.net>
Link: http://lkml.kernel.org/r/1433145945-789-9-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | arch/sparc/kernel/irq_64.c | 15 | ||||
-rw-r--r-- | arch/sparc/kernel/sun4d_irq.c | 4 | ||||
-rw-r--r-- | arch/sparc/kernel/sun4m_irq.c | 6 |
3 files changed, 15 insertions, 10 deletions
diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c index 4033c23bdfa6..5130f6e3e68e 100644 --- a/arch/sparc/kernel/irq_64.c +++ b/arch/sparc/kernel/irq_64.c | |||
@@ -210,21 +210,21 @@ struct irq_handler_data { | |||
210 | 210 | ||
211 | static inline unsigned int irq_data_to_handle(struct irq_data *data) | 211 | static inline unsigned int irq_data_to_handle(struct irq_data *data) |
212 | { | 212 | { |
213 | struct irq_handler_data *ihd = data->handler_data; | 213 | struct irq_handler_data *ihd = irq_data_get_irq_handler_data(data); |
214 | 214 | ||
215 | return ihd->dev_handle; | 215 | return ihd->dev_handle; |
216 | } | 216 | } |
217 | 217 | ||
218 | static inline unsigned int irq_data_to_ino(struct irq_data *data) | 218 | static inline unsigned int irq_data_to_ino(struct irq_data *data) |
219 | { | 219 | { |
220 | struct irq_handler_data *ihd = data->handler_data; | 220 | struct irq_handler_data *ihd = irq_data_get_irq_handler_data(data); |
221 | 221 | ||
222 | return ihd->dev_ino; | 222 | return ihd->dev_ino; |
223 | } | 223 | } |
224 | 224 | ||
225 | static inline unsigned long irq_data_to_sysino(struct irq_data *data) | 225 | static inline unsigned long irq_data_to_sysino(struct irq_data *data) |
226 | { | 226 | { |
227 | struct irq_handler_data *ihd = data->handler_data; | 227 | struct irq_handler_data *ihd = irq_data_get_irq_handler_data(data); |
228 | 228 | ||
229 | return ihd->sysino; | 229 | return ihd->sysino; |
230 | } | 230 | } |
@@ -370,8 +370,9 @@ static int irq_choose_cpu(unsigned int irq, const struct cpumask *affinity) | |||
370 | 370 | ||
371 | static void sun4u_irq_enable(struct irq_data *data) | 371 | static void sun4u_irq_enable(struct irq_data *data) |
372 | { | 372 | { |
373 | struct irq_handler_data *handler_data = data->handler_data; | 373 | struct irq_handler_data *handler_data; |
374 | 374 | ||
375 | handler_data = irq_data_get_irq_handler_data(data); | ||
375 | if (likely(handler_data)) { | 376 | if (likely(handler_data)) { |
376 | unsigned long cpuid, imap, val; | 377 | unsigned long cpuid, imap, val; |
377 | unsigned int tid; | 378 | unsigned int tid; |
@@ -393,8 +394,9 @@ static void sun4u_irq_enable(struct irq_data *data) | |||
393 | static int sun4u_set_affinity(struct irq_data *data, | 394 | static int sun4u_set_affinity(struct irq_data *data, |
394 | const struct cpumask *mask, bool force) | 395 | const struct cpumask *mask, bool force) |
395 | { | 396 | { |
396 | struct irq_handler_data *handler_data = data->handler_data; | 397 | struct irq_handler_data *handler_data; |
397 | 398 | ||
399 | handler_data = irq_data_get_irq_handler_data(data); | ||
398 | if (likely(handler_data)) { | 400 | if (likely(handler_data)) { |
399 | unsigned long cpuid, imap, val; | 401 | unsigned long cpuid, imap, val; |
400 | unsigned int tid; | 402 | unsigned int tid; |
@@ -438,8 +440,9 @@ static void sun4u_irq_disable(struct irq_data *data) | |||
438 | 440 | ||
439 | static void sun4u_irq_eoi(struct irq_data *data) | 441 | static void sun4u_irq_eoi(struct irq_data *data) |
440 | { | 442 | { |
441 | struct irq_handler_data *handler_data = data->handler_data; | 443 | struct irq_handler_data *handler_data; |
442 | 444 | ||
445 | handler_data = irq_data_get_irq_handler_data(data); | ||
443 | if (likely(handler_data)) | 446 | if (likely(handler_data)) |
444 | upa_writeq(ICLR_IDLE, handler_data->iclr); | 447 | upa_writeq(ICLR_IDLE, handler_data->iclr); |
445 | } | 448 | } |
diff --git a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c index a1bb2675b280..a87d0e47c168 100644 --- a/arch/sparc/kernel/sun4d_irq.c +++ b/arch/sparc/kernel/sun4d_irq.c | |||
@@ -188,7 +188,7 @@ void sun4d_handler_irq(unsigned int pil, struct pt_regs *regs) | |||
188 | 188 | ||
189 | static void sun4d_mask_irq(struct irq_data *data) | 189 | static void sun4d_mask_irq(struct irq_data *data) |
190 | { | 190 | { |
191 | struct sun4d_handler_data *handler_data = data->handler_data; | 191 | struct sun4d_handler_data *handler_data = irq_data_get_irq_handler_data(data); |
192 | unsigned int real_irq; | 192 | unsigned int real_irq; |
193 | #ifdef CONFIG_SMP | 193 | #ifdef CONFIG_SMP |
194 | int cpuid = handler_data->cpuid; | 194 | int cpuid = handler_data->cpuid; |
@@ -206,7 +206,7 @@ static void sun4d_mask_irq(struct irq_data *data) | |||
206 | 206 | ||
207 | static void sun4d_unmask_irq(struct irq_data *data) | 207 | static void sun4d_unmask_irq(struct irq_data *data) |
208 | { | 208 | { |
209 | struct sun4d_handler_data *handler_data = data->handler_data; | 209 | struct sun4d_handler_data *handler_data = irq_data_get_irq_handler_data(data); |
210 | unsigned int real_irq; | 210 | unsigned int real_irq; |
211 | #ifdef CONFIG_SMP | 211 | #ifdef CONFIG_SMP |
212 | int cpuid = handler_data->cpuid; | 212 | int cpuid = handler_data->cpuid; |
diff --git a/arch/sparc/kernel/sun4m_irq.c b/arch/sparc/kernel/sun4m_irq.c index 8bb3b3fddea7..da737c712fa8 100644 --- a/arch/sparc/kernel/sun4m_irq.c +++ b/arch/sparc/kernel/sun4m_irq.c | |||
@@ -188,9 +188,10 @@ static unsigned long sun4m_imask[0x50] = { | |||
188 | 188 | ||
189 | static void sun4m_mask_irq(struct irq_data *data) | 189 | static void sun4m_mask_irq(struct irq_data *data) |
190 | { | 190 | { |
191 | struct sun4m_handler_data *handler_data = data->handler_data; | 191 | struct sun4m_handler_data *handler_data; |
192 | int cpu = smp_processor_id(); | 192 | int cpu = smp_processor_id(); |
193 | 193 | ||
194 | handler_data = irq_data_get_irq_handler_data(data); | ||
194 | if (handler_data->mask) { | 195 | if (handler_data->mask) { |
195 | unsigned long flags; | 196 | unsigned long flags; |
196 | 197 | ||
@@ -206,9 +207,10 @@ static void sun4m_mask_irq(struct irq_data *data) | |||
206 | 207 | ||
207 | static void sun4m_unmask_irq(struct irq_data *data) | 208 | static void sun4m_unmask_irq(struct irq_data *data) |
208 | { | 209 | { |
209 | struct sun4m_handler_data *handler_data = data->handler_data; | 210 | struct sun4m_handler_data *handler_data; |
210 | int cpu = smp_processor_id(); | 211 | int cpu = smp_processor_id(); |
211 | 212 | ||
213 | handler_data = irq_data_get_irq_handler_data(data); | ||
212 | if (handler_data->mask) { | 214 | if (handler_data->mask) { |
213 | unsigned long flags; | 215 | unsigned long flags; |
214 | 216 | ||