new->flags &= ~IRQF_ONESHOT;
mutex_lock(&desc->request_mutex);
+ if (!desc->action) {
+ ret = irq_request_resources(desc);
+ if (ret) {
+ pr_err("Failed to request resources for %s (irq %d) on irqchip %s\n",
+ new->name, irq, desc->irq_data.chip->name);
+ goto out_mutex;
+ }
+ }
chip_bus_lock(desc);
}
if (!shared) {
- ret = irq_request_resources(desc);
- if (ret) {
- pr_err("Failed to request resources for %s (irq %d) on irqchip %s\n",
- new->name, irq, desc->irq_data.chip->name);
- goto out_unlock;
- }
-
init_waitqueue_head(&desc->wait_for_threads);
/* Setup the type (level, edge polarity) if configured: */
chip_bus_sync_unlock(desc);
+ if (!desc->action)
+ irq_release_resources(desc);
+
+out_mutex:
mutex_unlock(&desc->request_mutex);
out_thread:
if (!desc->action) {
irq_settings_clr_disable_unlazy(desc);
irq_shutdown(desc);
- irq_release_resources(desc);
irq_remove_timings(desc);
}
}
}
+ if (!desc->action)
+ irq_release_resources(desc);
+
mutex_unlock(&desc->request_mutex);
irq_chip_pm_put(&desc->irq_data);