diff options
author | Bastian Hecht <hechtb@googlemail.com> | 2012-03-16 12:19:29 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2012-03-27 12:20:19 -0400 |
commit | e82b4ac94e5c43fad51b975aed058858ceda1f0f (patch) | |
tree | 40c1f770d227f109c6d11c7b23ef20638beea406 /drivers/mmc/host | |
parent | 4932bd64a2bb4e80b79efb20c4736ac3b30ba7fe (diff) |
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')
-rw-r--r-- | drivers/mmc/host/sh_mobile_sdhi.c | 13 |
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) | |||
109 | mmc_data = &priv->mmc_data; | 109 | mmc_data = &priv->mmc_data; |
110 | p->pdata = mmc_data; | 110 | p->pdata = mmc_data; |
111 | 111 | ||
112 | if (p->init) { | ||
113 | ret = p->init(pdev); | ||
114 | if (ret) | ||
115 | goto einit; | ||
116 | } | ||
117 | |||
112 | snprintf(clk_name, sizeof(clk_name), "sdhi%d", pdev->id); | 118 | snprintf(clk_name, sizeof(clk_name), "sdhi%d", pdev->id); |
113 | priv->clk = clk_get(&pdev->dev, clk_name); | 119 | priv->clk = clk_get(&pdev->dev, clk_name); |
114 | if (IS_ERR(priv->clk)) { | 120 | if (IS_ERR(priv->clk)) { |
@@ -233,6 +239,9 @@ eirq_card_detect: | |||
233 | eprobe: | 239 | eprobe: |
234 | clk_put(priv->clk); | 240 | clk_put(priv->clk); |
235 | eclkget: | 241 | eclkget: |
242 | if (p->cleanup) | ||
243 | p->cleanup(pdev); | ||
244 | einit: | ||
236 | kfree(priv); | 245 | kfree(priv); |
237 | return ret; | 246 | return ret; |
238 | } | 247 | } |
@@ -257,6 +266,10 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev) | |||
257 | } | 266 | } |
258 | 267 | ||
259 | clk_put(priv->clk); | 268 | clk_put(priv->clk); |
269 | |||
270 | if (p->cleanup) | ||
271 | p->cleanup(pdev); | ||
272 | |||
260 | kfree(priv); | 273 | kfree(priv); |
261 | 274 | ||
262 | return 0; | 275 | return 0; |