Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358487
b: refs/heads/master
c: e4d43c1
h: refs/heads/master
i:
  358485: c4d0c23
  358483: 0421b35
  358479: 8d9376f
v: v3
  • Loading branch information
Sachin Kamat authored and Vinod Koul committed Jan 8, 2013
1 parent ba62697 commit 088ebd3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a14acb4ac2a1486f6633c55eb7f7ded07f3ec9fc
refs/heads/master: e4d43c1764bc3ee1150f24e530db2b5b23e91425
37 changes: 10 additions & 27 deletions trunk/drivers/dma/pl330.c
Original file line number Diff line number Diff line change
Expand Up @@ -2866,7 +2866,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
pdat = adev->dev.platform_data;

/* Allocate a new DMAC and its Channels */
pdmac = kzalloc(sizeof(*pdmac), GFP_KERNEL);
pdmac = devm_kzalloc(&adev->dev, sizeof(*pdmac), GFP_KERNEL);
if (!pdmac) {
dev_err(&adev->dev, "unable to allocate mem\n");
return -ENOMEM;
Expand All @@ -2878,25 +2878,21 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
pi->mcbufsz = pdat ? pdat->mcbuf_sz : 0;

res = &adev->res;
request_mem_region(res->start, resource_size(res), "dma-pl330");

pi->base = ioremap(res->start, resource_size(res));
if (!pi->base) {
ret = -ENXIO;
goto probe_err1;
}
pi->base = devm_request_and_ioremap(&adev->dev, res);
if (!pi->base)
return -ENXIO;

amba_set_drvdata(adev, pdmac);

irq = adev->irq[0];
ret = request_irq(irq, pl330_irq_handler, 0,
dev_name(&adev->dev), pi);
if (ret)
goto probe_err2;
return ret;

ret = pl330_add(pi);
if (ret)
goto probe_err3;
goto probe_err1;

INIT_LIST_HEAD(&pdmac->desc_pool);
spin_lock_init(&pdmac->pool_lock);
Expand All @@ -2918,7 +2914,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
if (!pdmac->peripherals) {
ret = -ENOMEM;
dev_err(&adev->dev, "unable to allocate pdmac->peripherals\n");
goto probe_err4;
goto probe_err2;
}

for (i = 0; i < num_chan; i++) {
Expand Down Expand Up @@ -2962,7 +2958,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
ret = dma_async_device_register(pd);
if (ret) {
dev_err(&adev->dev, "unable to register DMAC\n");
goto probe_err4;
goto probe_err2;
}

dev_info(&adev->dev,
Expand All @@ -2975,15 +2971,10 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)

return 0;

probe_err4:
pl330_del(pi);
probe_err3:
free_irq(irq, pi);
probe_err2:
iounmap(pi->base);
pl330_del(pi);
probe_err1:
release_mem_region(res->start, resource_size(res));
kfree(pdmac);
free_irq(irq, pi);

return ret;
}
Expand All @@ -2993,7 +2984,6 @@ static int __devexit 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;
struct resource *res;
int irq;

if (!pdmac)
Expand All @@ -3020,13 +3010,6 @@ static int __devexit pl330_remove(struct amba_device *adev)
irq = adev->irq[0];
free_irq(irq, pi);

iounmap(pi->base);

res = &adev->res;
release_mem_region(res->start, resource_size(res));

kfree(pdmac);

return 0;
}

Expand Down

0 comments on commit 088ebd3

Please sign in to comment.