Skip to content

Commit

Permalink
PCI/MSI: pci-xgene-msi: Consolidate chained IRQ handler install/remove
Browse files Browse the repository at this point in the history
Chained irq handlers usually set up handler data as well. We now have
a function to set both under irq_desc->lock. Replace the two calls
with one.
    
Search and conversion was done with coccinelle.

Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: Duc Dang <dhdang@apm.com>
  • Loading branch information
Thomas Gleixner committed Aug 1, 2015
1 parent f70229e commit 36f024e
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions drivers/pci/host/pci-xgene-msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,8 @@ static int xgene_msi_remove(struct platform_device *pdev)

for (i = 0; i < NR_HW_IRQS; i++) {
virq = msi->msi_groups[i].gic_irq;
if (virq != 0) {
irq_set_chained_handler(virq, NULL);
irq_set_handler_data(virq, NULL);
}
if (virq != 0)
irq_set_chained_handler_and_data(virq, NULL, NULL);
}
kfree(msi->msi_groups);

Expand Down Expand Up @@ -421,8 +419,8 @@ static int xgene_msi_hwirq_alloc(unsigned int cpu)
}

if (err) {
irq_set_chained_handler(msi_group->gic_irq, NULL);
irq_set_handler_data(msi_group->gic_irq, NULL);
irq_set_chained_handler_and_data(msi_group->gic_irq,
NULL, NULL);
return err;
}
}
Expand All @@ -441,8 +439,8 @@ static void xgene_msi_hwirq_free(unsigned int cpu)
if (!msi_group->gic_irq)
continue;

irq_set_chained_handler(msi_group->gic_irq, NULL);
irq_set_handler_data(msi_group->gic_irq, NULL);
irq_set_chained_handler_and_data(msi_group->gic_irq, NULL,
NULL);
}
}

Expand Down

0 comments on commit 36f024e

Please sign in to comment.