Skip to content

Commit

Permalink
mmc: omap: Convert to devm_kzalloc
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jarkko Nikula authored and Chris Ball committed Feb 22, 2014
1 parent 0e5c93e commit ae9b79c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/mmc/host/omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1345,7 +1345,8 @@ static int mmc_omap_probe(struct platform_device *pdev)
if (res == NULL)
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) {
ret = -ENOMEM;
goto err_free_mem_region;
Expand Down Expand Up @@ -1465,7 +1466,6 @@ static int mmc_omap_probe(struct platform_device *pdev)
err_free_mmc_host:
iounmap(host->virt_base);
err_ioremap:
kfree(host);
err_free_mem_region:
release_mem_region(res->start, resource_size(res));
return ret;
Expand Down Expand Up @@ -1500,8 +1500,6 @@ static int mmc_omap_remove(struct platform_device *pdev)
pdev->resource[0].end - pdev->resource[0].start + 1);
destroy_workqueue(host->mmc_omap_wq);

kfree(host);

return 0;
}

Expand Down

0 comments on commit ae9b79c

Please sign in to comment.