Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312831
b: refs/heads/master
c: c7bb448
h: refs/heads/master
i:
  312829: 7f73e50
  312827: c728b35
  312823: 95d1642
  312815: 46153cd
  312799: 79a3814
  312767: 2d99c79
  312703: 95e4bc1
  312575: 899f2c1
  312319: 30705be
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Chris Ball committed Jul 21, 2012
1 parent 909634b commit fe104cd
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3071cafb7f6f9cbb52b1b7eb308c8b45cae0dcf8
refs/heads/master: c7bb4487a3474c03986758595fcae1cfb771b3b0
35 changes: 23 additions & 12 deletions trunk/drivers/mmc/host/sh_mobile_sdhi.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <linux/kernel.h>
#include <linux/clk.h>
#include <linux/slab.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/mmc/host.h>
Expand Down Expand Up @@ -133,12 +134,14 @@ 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, &sdhi_ops);
if (ret)
goto einit;
if (p) {
p->pdata = mmc_data;
if (p->init) {
ret = p->init(pdev, &sdhi_ops);
if (ret)
goto einit;
}
}

snprintf(clk_name, sizeof(clk_name), "sdhi%d", pdev->id);
Expand All @@ -149,10 +152,6 @@ 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;
mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED;
Expand All @@ -164,6 +163,10 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
mmc_data->capabilities |= p->tmio_caps;
mmc_data->capabilities2 |= p->tmio_caps2;
mmc_data->cd_gpio = p->cd_gpio;
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;

if (p->dma_slave_tx > 0 && p->dma_slave_rx > 0) {
priv->param_tx.slave_id = p->dma_slave_tx;
Expand Down Expand Up @@ -269,7 +272,7 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev)
eprobe:
clk_put(priv->clk);
eclkget:
if (p->cleanup)
if (p && p->cleanup)
p->cleanup(pdev);
einit:
kfree(priv);
Expand All @@ -284,7 +287,8 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev)
struct sh_mobile_sdhi_info *p = pdev->dev.platform_data;
int i = 0, irq;

p->pdata = NULL;
if (p)
p->pdata = NULL;

tmio_mmc_host_remove(host);

Expand All @@ -297,7 +301,7 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev)

clk_put(priv->clk);

if (p->cleanup)
if (p && p->cleanup)
p->cleanup(pdev);

kfree(priv);
Expand All @@ -312,11 +316,18 @@ static const struct dev_pm_ops tmio_mmc_dev_pm_ops = {
.runtime_resume = tmio_mmc_host_runtime_resume,
};

static const struct of_device_id sh_mobile_sdhi_of_match[] = {
{ .compatible = "renesas,shmobile-sdhi" },
{ }
};
MODULE_DEVICE_TABLE(of, sh_mobile_sdhi_of_match);

static struct platform_driver sh_mobile_sdhi_driver = {
.driver = {
.name = "sh_mobile_sdhi",
.owner = THIS_MODULE,
.pm = &tmio_mmc_dev_pm_ops,
.of_match_table = sh_mobile_sdhi_of_match,
},
.probe = sh_mobile_sdhi_probe,
.remove = __devexit_p(sh_mobile_sdhi_remove),
Expand Down

0 comments on commit fe104cd

Please sign in to comment.