[RFC PATCH 3/5] irq: Use irq_alloc_desc_at instead of irq_reserve_irq

From: Yinghai Lu
Date: Sun Apr 06 2014 - 01:39:31 EST


irq_reserve_irq actually only set bit allocated_irq, and it is not really
"reserve" and cause confusion.

For !CONFIG_SPARSE_IRQ path, irq_alloc_desc_at() will only set bit
in allocated_irq.

We can use that instead, kill one irq_reserve_irq() calling.

Signed-off-by: Yinghai Lu <yinghai@xxxxxxxxxx>
---
kernel/irq/chip.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 6397df2..aff7481 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -28,8 +28,13 @@
int irq_set_chip(unsigned int irq, struct irq_chip *chip)
{
unsigned long flags;
- struct irq_desc *desc = irq_get_desc_lock(irq, &flags, 0);
+ struct irq_desc *desc;
+
+#ifndef CONFIG_SPARSE_IRQ
+ irq_alloc_desc_at(irq, 0);
+#endif

+ desc = irq_get_desc_lock(irq, &flags, 0);
if (!desc)
return -EINVAL;

@@ -38,12 +43,7 @@ int irq_set_chip(unsigned int irq, struct irq_chip *chip)

desc->irq_data.chip = chip;
irq_put_desc_unlock(desc, flags);
- /*
- * For !CONFIG_SPARSE_IRQ make the irq show up in
- * allocated_irqs. For the CONFIG_SPARSE_IRQ case, it is
- * already marked, and this call is harmless.
- */
- irq_reserve_irq(irq);
+
return 0;
}
EXPORT_SYMBOL(irq_set_chip);
--
1.8.4.5

--
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/