[patch 2/5] sh/irq: Use irq accessor functions instead of open coded access

From: Thomas Gleixner
Date: Mon Jul 13 2015 - 16:53:45 EST


From: Jiang Liu <jiang.liu@xxxxxxxxxxxxxxx>

This is a preparatory patch for refactoring the internals if irq_data.

Signed-off-by: Jiang Liu <jiang.liu@xxxxxxxxxxxxxxx>
Cc: Simon Horman <horms@xxxxxxxxxxxx>
Cc: Magnus Damm <magnus.damm@xxxxxxxxx>
Link: http://lkml.kernel.org/r/1433145945-789-12-git-send-email-jiang.liu@xxxxxxxxxxxxxxx
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
---
drivers/sh/intc/virq.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

Index: tip/drivers/sh/intc/virq.c
===================================================================
--- tip.orig/drivers/sh/intc/virq.c
+++ tip/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

entry->irq = virq;

- *last = entry;
+ if (last)
+ *last = entry;
+ else
+ irq_set_handler_data(irq, entry);

return 0;
}


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/