aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2012-06-20 13:10:34 -0400
committerChris Ball <cjb@laptop.org>2012-07-21 00:02:11 -0400
commit71da63e767c393c0ebbd3c65df428df0ce42a16c (patch)
tree5c6ce3cc09ae36c3f5f8e33c6de75ea8673ad009 /drivers/mmc
parentb958a67c6bbe0a886bebc618aac7a059cdbab418 (diff)
mmc: sdhi: do not install dummy callbacks
Currently the SDHI glue for the TMIO MMC driver installs dummy .get_cd() and .set_pwr() callbacks even if the platform didn't supply them. This is not necessary, since the TMIO MMC driver itself checks for NULL callbacks. This is also dubious if the platform provides a regulator for SD-card power switching. It is better to only install those callbacks, if they are really provided by the platform. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sh_mobile_sdhi.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index d8b167c8493a..42f07fa6e043 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -64,18 +64,14 @@ static void sh_mobile_sdhi_set_pwr(struct platform_device *pdev, int state)
64{ 64{
65 struct sh_mobile_sdhi_info *p = pdev->dev.platform_data; 65 struct sh_mobile_sdhi_info *p = pdev->dev.platform_data;
66 66
67 if (p && p->set_pwr) 67 p->set_pwr(pdev, state);
68 p->set_pwr(pdev, state);
69} 68}
70 69
71static int sh_mobile_sdhi_get_cd(struct platform_device *pdev) 70static int sh_mobile_sdhi_get_cd(struct platform_device *pdev)
72{ 71{
73 struct sh_mobile_sdhi_info *p = pdev->dev.platform_data; 72 struct sh_mobile_sdhi_info *p = pdev->dev.platform_data;
74 73
75 if (p && p->get_cd) 74 return p->get_cd(pdev);
76 return p->get_cd(pdev);
77 else
78 return -ENOSYS;
79} 75}
80 76
81static int sh_mobile_sdhi_wait_idle(struct tmio_mmc_host *host) 77static int sh_mobile_sdhi_wait_idle(struct tmio_mmc_host *host)
@@ -153,8 +149,10 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
153 goto eclkget; 149 goto eclkget;
154 } 150 }
155 151
156 mmc_data->set_pwr = sh_mobile_sdhi_set_pwr; 152 if (p->set_pwr)
157 mmc_data->get_cd = sh_mobile_sdhi_get_cd; 153 mmc_data->set_pwr = sh_mobile_sdhi_set_pwr;
154 if (p->get_cd)
155 mmc_data->get_cd = sh_mobile_sdhi_get_cd;
158 mmc_data->clk_enable = sh_mobile_sdhi_clk_enable; 156 mmc_data->clk_enable = sh_mobile_sdhi_clk_enable;
159 mmc_data->clk_disable = sh_mobile_sdhi_clk_disable; 157 mmc_data->clk_disable = sh_mobile_sdhi_clk_disable;
160 mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED; 158 mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED;