Again, using the managed API for allocating a threaded interrupt would be the recommended approach for a modern driver. The kernel provides the devm_request_threaded_irq() API for this very purpose:
#include linux/interrupt.h
int __must_check
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);
All the parameters besides the first one, which is the pointer to the device structure, are the same as those for request_threaded_irq(). The key advantage of this is that you don't need to worry about freeing up the IRQ line. The kernel will auto-free it on device detach or driver removal, as we learned with devm_request_irq(). As with request_threaded_irq(), the return value from devm_request_threaded_irq() ...