From: Jiang Liu Date: Mon, 13 Jul 2015 20:51:22 +0000 (+0000) Subject: sh/irq: Use irq accessor functions instead of open coded access X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d0abe2f3a9a541ded2e30ef7275f057fb7f0335a;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Cc: Simon Horman Cc: Magnus Damm Link: http://lkml.kernel.org/r/20150713151626.616384365@linutronix.de Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- 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); static int add_virq_to_pirq(unsigned int irq, unsigned int virq) { - struct intc_virq_list **last, *entry; - struct irq_data *data = irq_get_irq_data(irq); + struct intc_virq_list *entry; + struct intc_virq_list **last = NULL; /* scan for duplicates */ - last = (struct intc_virq_list **)&data->handler_data; - for_each_virq(entry, data->handler_data) { + for_each_virq(entry, irq_get_handler_data(irq)) { if (entry->irq == virq) return 0; last = &entry->next; @@ -102,7 +101,10 @@ static int add_virq_to_pirq(unsigned int irq, unsigned int virq) entry->irq = virq; - *last = entry; + if (last) + *last = entry; + else + irq_set_handler_data(irq, entry); return 0; }