/* If an IRQ allocated with this function needs to be freed separately, dev_free_irq() must be used.  */
int devm_request_threaded_irq(struct device *dev, unsigned int irq, irq_handler_t handler, irq_handler_t thread_fn, unsigned long irqflags, const char *devname, void *dev_id)
/* If an IRQ allocated with this function needs to be freed separately, dev_free_irq() must be used.  */
int devm_request_threaded_irq(struct device *dev, unsigned int irq, irq_handler_t handler, irq_handler_t thread_fn, unsigned long irqflags, const char *devname, void *dev_id)
{
	struct irq_devres *dr;
	int rc;
	dr = devres_alloc(devm_irq_release, sizeof(struct irq_devres),
			  GFP_KERNEL);
	if (!dr)
		return -ENOMEM;
	rc = request_threaded_irq(irq, handler, thread_fn, irqflags, devname,
				  dev_id);
	if (rc) {
		devres_free(dr);
		return rc;
	}
	dr->irq = irq;
	dr->dev_id = dev_id;
	devres_add(dev, dr);
	return 0;
}