diff options
-rw-r--r-- | drivers/mmc/host/sh_mobile_sdhi.c | 13 | ||||
-rw-r--r-- | include/linux/mmc/sh_mobile_sdhi.h | 4 |
2 files changed, 17 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; |
diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h index 082a736a9bfb..686b85bfb7a5 100644 --- a/include/linux/mmc/sh_mobile_sdhi.h +++ b/include/linux/mmc/sh_mobile_sdhi.h | |||
@@ -20,6 +20,10 @@ struct sh_mobile_sdhi_info { | |||
20 | struct tmio_mmc_data *pdata; | 20 | struct tmio_mmc_data *pdata; |
21 | void (*set_pwr)(struct platform_device *pdev, int state); | 21 | void (*set_pwr)(struct platform_device *pdev, int state); |
22 | int (*get_cd)(struct platform_device *pdev); | 22 | int (*get_cd)(struct platform_device *pdev); |
23 | |||
24 | /* callbacks for board specific setup code */ | ||
25 | int (*init)(struct platform_device *pdev); | ||
26 | void (*cleanup)(struct platform_device *pdev); | ||
23 | }; | 27 | }; |
24 | 28 | ||
25 | #endif /* LINUX_MMC_SH_MOBILE_SDHI_H */ | 29 | #endif /* LINUX_MMC_SH_MOBILE_SDHI_H */ |