Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332828
b: refs/heads/master
c: bb8bdc7
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Abraham authored and Chris Ball committed Oct 3, 2012
1 parent b8837e0 commit c392b77
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 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: 4a90920c6b39a3af26470cfc26b8e5ec9c4e7f3c
refs/heads/master: bb8bdc77efdecc868d522691487d261ac32d3237
29 changes: 8 additions & 21 deletions trunk/drivers/mmc/host/dw_mmc-pltfm.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,38 +27,27 @@ static int __devinit dw_mci_pltfm_probe(struct platform_device *pdev)
struct resource *regs;
int ret;

host = kzalloc(sizeof(struct dw_mci), GFP_KERNEL);
host = devm_kzalloc(&pdev->dev, sizeof(struct dw_mci), GFP_KERNEL);
if (!host)
return -ENOMEM;

regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!regs) {
ret = -ENXIO;
goto err_free;
}
if (!regs)
return -ENXIO;

host->irq = platform_get_irq(pdev, 0);
if (host->irq < 0) {
ret = host->irq;
goto err_free;
}
if (host->irq < 0)
return host->irq;

host->dev = &pdev->dev;
host->irq_flags = 0;
host->pdata = pdev->dev.platform_data;
ret = -ENOMEM;
host->regs = ioremap(regs->start, resource_size(regs));
host->regs = devm_request_and_ioremap(&pdev->dev, regs);
if (!host->regs)
goto err_free;
return -ENOMEM;

platform_set_drvdata(pdev, host);
ret = dw_mci_probe(host);
if (ret)
goto err_out;
return ret;
err_out:
iounmap(host->regs);
err_free:
kfree(host);
return ret;
}

Expand All @@ -68,8 +57,6 @@ static int __devexit dw_mci_pltfm_remove(struct platform_device *pdev)

platform_set_drvdata(pdev, NULL);
dw_mci_remove(host);
iounmap(host->regs);
kfree(host);
return 0;
}

Expand Down

0 comments on commit c392b77

Please sign in to comment.