summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/sh_mobile_sdhi.c
diff options
context:
space:
mode:
authorBastian Hecht2012-03-16 17:19:29 +0100
committerChris Ball2012-03-27 18:20:19 +0200
commite82b4ac94e5c43fad51b975aed058858ceda1f0f (patch)
tree40c1f770d227f109c6d11c7b23ef20638beea406 /drivers/mmc/host/sh_mobile_sdhi.c
parentmmc: tmio: cosmetic: prettify the tmio_mmc_set_ios() function (diff)
downloadkernel-qcow2-linux-e82b4ac94e5c43fad51b975aed058858ceda1f0f.tar.gz
kernel-qcow2-linux-e82b4ac94e5c43fad51b975aed058858ceda1f0f.tar.xz
kernel-qcow2-linux-e82b4ac94e5c43fad51b975aed058858ceda1f0f.zip
mmc: sh_mobile_sdhi: add a callback for board specific init code
Some boards need a preliminary setup stage to prepare the sdhi controller. Signed-off-by: Bastian Hecht <hechtb@gmail.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/sh_mobile_sdhi.c')
-rw-r--r--drivers/mmc/host/sh_mobile_sdhi.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index f91c3aa40d1d..07ff3fee77b3 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -109,6 +109,12 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
mmc_data = &priv->mmc_data;
p->pdata = mmc_data;
+ if (p->init) {
+ ret = p->init(pdev);
+ if (ret)
+ goto einit;
+ }
+
snprintf(clk_name, sizeof(clk_name), "sdhi%d", pdev->id);
priv->clk = clk_get(&pdev->dev, clk_name);
if (IS_ERR(priv->clk)) {
@@ -233,6 +239,9 @@ eirq_card_detect:
eprobe:
clk_put(priv->clk);
eclkget:
+ if (p->cleanup)
+ p->cleanup(pdev);
+einit:
kfree(priv);
return ret;
}
@@ -257,6 +266,10 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev)
}
clk_put(priv->clk);
+
+ if (p->cleanup)
+ p->cleanup(pdev);
+
kfree(priv);
return 0;