Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jiang Liu and committed by
Ingo Molnar
d0abe2f3 cde5c275

+7 -5
+7 -5
drivers/sh/intc/virq.c
··· 83 83 84 84 static int add_virq_to_pirq(unsigned int irq, unsigned int virq) 85 85 { 86 - struct intc_virq_list **last, *entry; 87 - struct irq_data *data = irq_get_irq_data(irq); 86 + struct intc_virq_list *entry; 87 + struct intc_virq_list **last = NULL; 88 88 89 89 /* scan for duplicates */ 90 - last = (struct intc_virq_list **)&data->handler_data; 91 - for_each_virq(entry, data->handler_data) { 90 + for_each_virq(entry, irq_get_handler_data(irq)) { 92 91 if (entry->irq == virq) 93 92 return 0; 94 93 last = &entry->next; ··· 101 102 102 103 entry->irq = virq; 103 104 104 - *last = entry; 105 + if (last) 106 + *last = entry; 107 + else 108 + irq_set_handler_data(irq, entry); 105 109 106 110 return 0; 107 111 }