mmc: sdhci-s3c: use devm_ functions
authorJulia Lawall <Julia.Lawall@lip6.fr>
Fri, 9 Mar 2012 04:24:53 +0000 (23:24 -0500)
committerChris Ball <cjb@laptop.org>
Fri, 6 Apr 2012 00:32:16 +0000 (20:32 -0400)
commit9bda6da7ff7d35ef757e235aae559e679d3a9493
treefb2e3eeb8d6175d6f82aa6a9de376a10d2f3b0a4
parent1d4dc338bb7cbbadcb5a527b1b0e897b5cde1701
mmc: sdhci-s3c: use devm_ functions

The various devm_ functions allocate memory that is released when a driver
detaches.  This patch uses these functions for data that is allocated in
the probe function of a platform device and is only freed in the remove
function.

By using devm_ioremap, it also removes a potential memory leak, because
there was no call to iounmap in the probe function.

The call to platform_get_resource was moved just to make it closer to the
place where its result it used.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/sdhci-s3c.c