]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
dma: mv_xor: add missing free_irq() call
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thu, 15 Nov 2012 15:11:18 +0000 (16:11 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 20 Nov 2012 14:59:00 +0000 (15:59 +0100)
Even though the driver cannot be unloaded at the moment, it is still
good to properly free the IRQ handlers in the channel removal function.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
drivers/dma/mv_xor.c
drivers/dma/mv_xor.h

index ec741b4607e2da9549bab469ac8da602d9775fac..d48245c0b0b0799e86441af1fcf4e120df8ab6c7 100644 (file)
@@ -1082,6 +1082,8 @@ static int mv_xor_channel_remove(struct mv_xor_chan *mv_chan)
                list_del(&chan->device_node);
        }
 
+       free_irq(mv_chan->irq, mv_chan);
+
        return 0;
 }
 
@@ -1101,6 +1103,7 @@ mv_xor_channel_add(struct mv_xor_device *xordev,
        }
 
        mv_chan->idx = idx;
+       mv_chan->irq = irq;
 
        dma_dev = &mv_chan->dmadev;
 
@@ -1147,7 +1150,7 @@ mv_xor_channel_add(struct mv_xor_device *xordev,
        /* clear errors before enabling interrupts */
        mv_xor_device_clear_err_status(mv_chan);
 
-       ret = devm_request_irq(&pdev->dev, irq,
+       ret = devm_request_irq(&pdev->dev, mv_chan->irq,
                               mv_xor_interrupt_handler,
                               0, dev_name(&pdev->dev), mv_chan);
        if (ret)
index 698b4487b348b75cf7e9051e46beb8c9d654832a..17043287b71af5fa56e87236d33bb1053fd54abf 100644 (file)
@@ -81,6 +81,7 @@ struct mv_xor_chan {
        spinlock_t              lock; /* protects the descriptor slot pool */
        void __iomem            *mmr_base;
        unsigned int            idx;
+       int                     irq;
        enum dma_transaction_type       current_type;
        struct list_head        chain;
        struct list_head        completed_slots;