mmc: omap: Convert to devm_kzalloc

Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Chris Ball <chris@printf.net>
This commit is contained in:
Jarkko Nikula 2014-02-22 18:01:38 +02:00 committed by Chris Ball
parent 0e5c93e020
commit ae9b79c634
1 changed files with 2 additions and 4 deletions

View File

@ -1345,7 +1345,8 @@ static int mmc_omap_probe(struct platform_device *pdev)
if (res == NULL) if (res == NULL)
return -EBUSY; return -EBUSY;
host = kzalloc(sizeof(struct mmc_omap_host), GFP_KERNEL); host = devm_kzalloc(&pdev->dev, sizeof(struct mmc_omap_host),
GFP_KERNEL);
if (host == NULL) { if (host == NULL) {
ret = -ENOMEM; ret = -ENOMEM;
goto err_free_mem_region; goto err_free_mem_region;
@ -1465,7 +1466,6 @@ static int mmc_omap_probe(struct platform_device *pdev)
err_free_mmc_host: err_free_mmc_host:
iounmap(host->virt_base); iounmap(host->virt_base);
err_ioremap: err_ioremap:
kfree(host);
err_free_mem_region: err_free_mem_region:
release_mem_region(res->start, resource_size(res)); release_mem_region(res->start, resource_size(res));
return ret; return ret;
@ -1500,8 +1500,6 @@ static int mmc_omap_remove(struct platform_device *pdev)
pdev->resource[0].end - pdev->resource[0].start + 1); pdev->resource[0].end - pdev->resource[0].start + 1);
destroy_workqueue(host->mmc_omap_wq); destroy_workqueue(host->mmc_omap_wq);
kfree(host);
return 0; return 0;
} }