Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 71da63e7 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Chris Ball
Browse files

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: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent b958a67c
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -64,7 +64,6 @@ static void sh_mobile_sdhi_set_pwr(struct platform_device *pdev, int state)
{
	struct sh_mobile_sdhi_info *p = pdev->dev.platform_data;

	if (p && p->set_pwr)
	p->set_pwr(pdev, state);
}

@@ -72,10 +71,7 @@ static int sh_mobile_sdhi_get_cd(struct platform_device *pdev)
{
	struct sh_mobile_sdhi_info *p = pdev->dev.platform_data;

	if (p && p->get_cd)
	return p->get_cd(pdev);
	else
		return -ENOSYS;
}

static int sh_mobile_sdhi_wait_idle(struct tmio_mmc_host *host)
@@ -153,7 +149,9 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
		goto eclkget;
	}

	if (p->set_pwr)
		mmc_data->set_pwr = sh_mobile_sdhi_set_pwr;
	if (p->get_cd)
		mmc_data->get_cd = sh_mobile_sdhi_get_cd;
	mmc_data->clk_enable = sh_mobile_sdhi_clk_enable;
	mmc_data->clk_disable = sh_mobile_sdhi_clk_disable;