1 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 When mv_xor_channel_add() fails for one XOR channel, we jump to the
4 err_channel_add label to clean up all previous channels that had been
5 initialized correctly. Unfortunately, while handling this error
6 condition, we were disposing the IRQ mapping before calling
7 mv_xor_channel_remove() (which does the free_irq()), which is
10 Instead, do things properly in the reverse order of the
11 initialization: first remove the XOR channel (so that free_irq() is
12 done), and then dispose the IRQ mapping.
14 This avoids ugly warnings when for some reason one of the XOR channel
17 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
19 drivers/dma/mv_xor.c | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
22 diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
23 index ac71f55..cc5d23d 100644
24 --- a/drivers/dma/mv_xor.c
25 +++ b/drivers/dma/mv_xor.c
26 @@ -1361,9 +1361,9 @@ static int mv_xor_probe(struct platform_device *pdev)
28 for (i = 0; i < MV_XOR_MAX_CHANNELS; i++)
29 if (xordev->channels[i]) {
30 + mv_xor_channel_remove(xordev->channels[i]);
31 if (pdev->dev.of_node)
32 irq_dispose_mapping(xordev->channels[i]->irq);
33 - mv_xor_channel_remove(xordev->channels[i]);
36 clk_disable_unprepare(xordev->clk);