@@ -118,7 +118,7 @@ EXPORT_SYMBOL_GPL(iio_dummy_evgen_get_regs);
static void iio_dummy_evgen_free(void)
{
- irq_domain_remove_sim(iio_evgen->irq_sim_domain);
+ irq_domain_remove(iio_evgen->irq_sim_domain);
kfree(iio_evgen);
}
@@ -21,7 +21,6 @@ struct irq_domain *irq_domain_create_sim(struct fwnode_handle *fwnode,
struct irq_domain *devm_irq_domain_create_sim(struct device *dev,
struct fwnode_handle *fwnode,
unsigned int num_irqs);
-void irq_domain_remove_sim(struct irq_domain *domain);
void irq_sim_fire(int virq);
#endif /* _LINUX_IRQ_SIM_H */
@@ -108,9 +108,19 @@ static void irq_sim_domain_unmap(struct irq_domain *domain, unsigned int virq)
kfree(irq_ctx);
}
+static void irq_sim_domain_remove(struct irq_domain *domain)
+{
+ struct irq_sim_work_ctx *work_ctx = domain->host_data;
+
+ irq_work_sync(&work_ctx->work);
+ bitmap_free(work_ctx->pending);
+ kfree(work_ctx);
+}
+
static const struct irq_domain_ops irq_sim_domain_ops = {
.map = irq_sim_domain_map,
.unmap = irq_sim_domain_unmap,
+ .remove = irq_sim_domain_remove,
};
/**
@@ -122,6 +132,8 @@ static const struct irq_domain_ops irq_sim_domain_ops = {
*
* On success: return a new irq_domain object.
* On failure: a negative errno wrapped with ERR_PTR().
+ *
+ * The returned domain can be freed using irq_domain_remove().
*/
struct irq_domain *irq_domain_create_sim(struct fwnode_handle *fwnode,
unsigned int num_irqs)
@@ -156,29 +168,11 @@ struct irq_domain *irq_domain_create_sim(struct fwnode_handle *fwnode,
}
EXPORT_SYMBOL_GPL(irq_domain_create_sim);
-/**
- * irq_domain_remove_sim - Deinitialize the interrupt simulator domain: free
- * the interrupt descriptors and allocated memory.
- *
- * @domain: The interrupt simulator domain to tear down.
- */
-void irq_domain_remove_sim(struct irq_domain *domain)
-{
- struct irq_sim_work_ctx *work_ctx = domain->host_data;
-
- irq_work_sync(&work_ctx->work);
- bitmap_free(work_ctx->pending);
- kfree(work_ctx);
-
- irq_domain_remove(domain);
-}
-EXPORT_SYMBOL_GPL(irq_domain_remove_sim);
-
static void devm_irq_domain_release_sim(struct device *dev, void *res)
{
struct irq_sim_devres *this = res;
- irq_domain_remove_sim(this->domain);
+ irq_domain_remove(this->domain);
}
/**