• T
    dma: mv_xor: use request_irq() instead of devm_request_irq() · 2d0a0745
    Thomas Petazzoni 提交于
    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: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
    2d0a0745
mv_xor.c 36.2 KB