+ * dynamic_irq_init - initialize a dynamically allocated irq
+ * @irq: irq number to initialize
+ */
+void dynamic_irq_init(unsigned int irq)
+{
+ struct irq_desc *desc;
+ unsigned long flags;
+
+ desc = irq_to_desc(irq);
+ if (!desc) {
+ WARN(1, KERN_ERR "Trying to initialize invalid IRQ%d\n", irq);
+ return;
+ }
+
+ /* Ensure we don't have left over values from a previous use of this irq */
+ raw_spin_lock_irqsave(&desc->lock, flags);
+ desc->status = IRQ_DISABLED;
+ desc->chip = &no_irq_chip;
+ desc->handle_irq = handle_bad_irq;
+ desc->depth = 1;
+ desc->msi_desc = NULL;
+ desc->handler_data = NULL;
+ desc->chip_data = NULL;
+ desc->action = NULL;
+ desc->irq_count = 0;
+ desc->irqs_unhandled = 0;
+#ifdef CONFIG_SMP
+ cpumask_setall(desc->affinity);
+#ifdef CONFIG_GENERIC_PENDING_IRQ
+ cpumask_clear(desc->pending_mask);
+#endif
+#endif
+ raw_spin_unlock_irqrestore(&desc->lock, flags);
+}
+
+/**
+ * dynamic_irq_cleanup - cleanup a dynamically allocated irq
+ * @irq: irq number to initialize
+ */
+void dynamic_irq_cleanup(unsigned int irq)
+{
+ struct irq_desc *desc = irq_to_desc(irq);
+ unsigned long flags;
+
+ if (!desc) {
+ WARN(1, KERN_ERR "Trying to cleanup invalid IRQ%d\n", irq);
+ return;
+ }
+
+ raw_spin_lock_irqsave(&desc->lock, flags);
+ if (desc->action) {
+ raw_spin_unlock_irqrestore(&desc->lock, flags);
+ WARN(1, KERN_ERR "Destroying IRQ%d without calling free_irq\n",
+ irq);
+ return;
+ }
+ desc->msi_desc = NULL;
+ desc->handler_data = NULL;
+ desc->chip_data = NULL;
+ desc->handle_irq = handle_bad_irq;
+ desc->chip = &no_irq_chip;
+ desc->name = NULL;
+ clear_kstat_irqs(desc);
+ raw_spin_unlock_irqrestore(&desc->lock, flags);
+}
+
+
+/**