lkml.org 
[lkml]   [2014]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 3/8] irq: Use irq_alloc_desc_at instead of irq_reserve_irq
Date
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@kernel.org>
---
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


\
 
 \ /
  Last update: 2014-05-06 04:21    [W:0.133 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site