dma: pl330: Simplify irq allocation
authorMichal Simek <michal.simek@xilinx.com>
Wed, 4 Sep 2013 14:40:17 +0000 (16:40 +0200)
committerVinod Koul <vinod.koul@intel.com>
Mon, 7 Oct 2013 02:11:38 +0000 (07:41 +0530)
Use devm_request_irq function.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/pl330.c

index a562d24d20bf55179436d16086ca90f63d1b1894..58623dc474d13e58f7a6c032f86d0c4b5237fa56 100644 (file)
@@ -2923,7 +2923,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
        amba_set_drvdata(adev, pdmac);
 
        irq = adev->irq[0];
-       ret = request_irq(irq, pl330_irq_handler, 0,
+       ret = devm_request_irq(&adev->dev, irq, pl330_irq_handler, 0,
                        dev_name(&adev->dev), pi);
        if (ret)
                return ret;
@@ -2931,7 +2931,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
        pi->pcfg.periph_id = adev->periphid;
        ret = pl330_add(pi);
        if (ret)
-               goto probe_err1;
+               return ret;
 
        INIT_LIST_HEAD(&pdmac->desc_pool);
        spin_lock_init(&pdmac->pool_lock);
@@ -3044,8 +3044,6 @@ probe_err3:
        }
 probe_err2:
        pl330_del(pi);
-probe_err1:
-       free_irq(irq, pi);
 
        return ret;
 }
@@ -3055,7 +3053,6 @@ static int pl330_remove(struct amba_device *adev)
        struct dma_pl330_dmac *pdmac = amba_get_drvdata(adev);
        struct dma_pl330_chan *pch, *_p;
        struct pl330_info *pi;
-       int irq;
 
        if (!pdmac)
                return 0;
@@ -3082,9 +3079,6 @@ static int pl330_remove(struct amba_device *adev)
 
        pl330_del(pi);
 
-       irq = adev->irq[0];
-       free_irq(irq, pi);
-
        return 0;
 }