diff options
| author | Jiang Liu <jiang.liu@linux.intel.com> | 2015-07-13 16:51:22 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2015-07-29 04:08:07 -0400 |
| commit | d0abe2f3a9a541ded2e30ef7275f057fb7f0335a (patch) | |
| tree | 6f2ab2f75dc9d5ec252bca53501165ef74e68e85 /drivers/sh/intc | |
| parent | cde5c2756832089e35b0c50417cc2858630f2005 (diff) | |
sh/irq: Use irq accessor functions instead of open coded access
This is a preparatory patch for refactoring the internals if irq_data.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Simon Horman <horms@verge.net.au>
Cc: Magnus Damm <magnus.damm@gmail.com>
Link: http://lkml.kernel.org/r/20150713151626.616384365@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/sh/intc')
| -rw-r--r-- | drivers/sh/intc/virq.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/sh/intc/virq.c b/drivers/sh/intc/virq.c index f5f1b821241a..0f735301d3ec 100644 --- a/drivers/sh/intc/virq.c +++ b/drivers/sh/intc/virq.c | |||
| @@ -83,12 +83,11 @@ EXPORT_SYMBOL_GPL(intc_irq_lookup); | |||
| 83 | 83 | ||
| 84 | static int add_virq_to_pirq(unsigned int irq, unsigned int virq) | 84 | static int add_virq_to_pirq(unsigned int irq, unsigned int virq) |
| 85 | { | 85 | { |
| 86 | struct intc_virq_list **last, *entry; | 86 | struct intc_virq_list *entry; |
| 87 | struct irq_data *data = irq_get_irq_data(irq); | 87 | struct intc_virq_list **last = NULL; |
| 88 | 88 | ||
| 89 | /* scan for duplicates */ | 89 | /* scan for duplicates */ |
| 90 | last = (struct intc_virq_list **)&data->handler_data; | 90 | for_each_virq(entry, irq_get_handler_data(irq)) { |
| 91 | for_each_virq(entry, data->handler_data) { | ||
| 92 | if (entry->irq == virq) | 91 | if (entry->irq == virq) |
| 93 | return 0; | 92 | return 0; |
| 94 | last = &entry->next; | 93 | last = &entry->next; |
| @@ -102,7 +101,10 @@ static int add_virq_to_pirq(unsigned int irq, unsigned int virq) | |||
| 102 | 101 | ||
| 103 | entry->irq = virq; | 102 | entry->irq = virq; |
| 104 | 103 | ||
| 105 | *last = entry; | 104 | if (last) |
| 105 | *last = entry; | ||
| 106 | else | ||
| 107 | irq_set_handler_data(irq, entry); | ||
| 106 | 108 | ||
| 107 | return 0; | 109 | return 0; |
| 108 | } | 110 | } |
