Searched hist:"2 d0a074517da34a6386bdd9a22bc006c8fa21044" (Results 1 – 1 of 1) sorted by relevance
/openbmc/linux/drivers/dma/ |
H A D | mv_xor.c | diff 2d0a074517da34a6386bdd9a22bc006c8fa21044 Thu Nov 22 11:19:09 CST 2012 Thomas Petazzoni <thomas.petazzoni@free-electrons.com> dma: mv_xor: use request_irq() instead of devm_request_irq()
Even through the usage of devm_*() functions is generally recommended over their classic variants, in the case of devm_request_irq() combined with irq_of_parse_and_map(), it doesn't work nicely.
We have the following scenario:
irq_of_parse_and_map(...) devm_request_irq(...)
For some reason, the driver initialization fails at a later point. Since irq_of_parse_and_map() is no device-managed, we do a:
irq_dispose_mapping(...)
Unfortunately, this doesn't work, because the free_irq() must be done prior to calling irq_dispose_mapping(). But with the devm mechanism, the automatic free_irq() would happen only after we get out of the ->probe() function.
So basically, we revert to using request_irq() with traditional error handling, so that in case of error, free_irq() gets called before irq_dispose_mapping().
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|