728x90
반응형
-. Same Feature: Support interrupt handling via kthread(request_threaded_irq).
-. Difference : `devm_*` additional support resource management for SoC based things.
-. How to use : `request_irq` apply for custom PC driver.
`devm_request_irq` apply for SoC based platform driver
for management platform_device's resource.
For example, Application Processor based platform.
-. `request_irq` (from http://lxr.free-electrons.com/source/kernel/irq/devres.c#L47)
128 request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags,
129 const char *name, void *dev) 130 { 131 return request_threaded_irq(irq, handler, NULL, flags, name, dev); 132 }
-. `devm_request_irq` (from http://lxr.free-electrons.com/source/include/linux/interrupt.h#L128)
47 int devm_request_threaded_irq(struct device *dev, unsigned int irq, 48 irq_handler_t handler, irq_handler_t thread_fn, 49 unsigned long irqflags, const char *devname, 50 void *dev_id) 51 { 52 struct irq_devres *dr; 53 int rc; 54 55 dr = devres_alloc(devm_irq_release, sizeof(struct irq_devres), 56 GFP_KERNEL); 57 if (!dr) 58 return -ENOMEM; 59 60 rc = request_threaded_irq(irq, handler, thread_fn, irqflags, devname, 61 dev_id); 62 if (rc) { 63 devres_free(dr); 64 return rc; 65 } 66 67 dr->irq = irq; 68 dr->dev_id = dev_id; 69 devres_add(dev, dr); 70 71 return 0; 72 } 73 EXPORT_SYMBOL(devm_request_threaded_irq);
728x90
반응형
댓글