Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 335525
b: refs/heads/master
c: cb27a84
h: refs/heads/master
i:
  335523: 290eec4
v: v3
  • Loading branch information
James Hogan authored and Chris Ball committed Nov 7, 2012
1 parent 66aab86 commit e5abe2a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 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: 2da1d7f2948900cd50d38643db39f790edb3cc96
refs/heads/master: cb27a843de9e3a0a2e4b7e631da4679d38f49cee
4 changes: 2 additions & 2 deletions trunk/drivers/mmc/host/dw_mmc-pltfm.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ int dw_mci_pltfm_register(struct platform_device *pdev,
if (!host->regs)
return -ENOMEM;

if (host->drv_data->init) {
ret = host->drv_data->init(host);
if (drv_data && drv_data->init) {
ret = drv_data->init(host);
if (ret)
return ret;
}
Expand Down
29 changes: 17 additions & 12 deletions trunk/drivers/mmc/host/dw_mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ static u32 dw_mci_prepare_command(struct mmc_host *mmc, struct mmc_command *cmd)
{
struct mmc_data *data;
struct dw_mci_slot *slot = mmc_priv(mmc);
struct dw_mci_drv_data *drv_data = slot->host->drv_data;
u32 cmdr;
cmd->error = -EINPROGRESS;

Expand Down Expand Up @@ -261,8 +262,8 @@ static u32 dw_mci_prepare_command(struct mmc_host *mmc, struct mmc_command *cmd)
cmdr |= SDMMC_CMD_DAT_WR;
}

if (slot->host->drv_data->prepare_command)
slot->host->drv_data->prepare_command(slot->host, &cmdr);
if (drv_data && drv_data->prepare_command)
drv_data->prepare_command(slot->host, &cmdr);

return cmdr;
}
Expand Down Expand Up @@ -772,6 +773,7 @@ static void dw_mci_request(struct mmc_host *mmc, struct mmc_request *mrq)
static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
{
struct dw_mci_slot *slot = mmc_priv(mmc);
struct dw_mci_drv_data *drv_data = slot->host->drv_data;
u32 regs;

/* set default 1 bit mode */
Expand Down Expand Up @@ -807,8 +809,8 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
slot->clock = ios->clock;
}

if (slot->host->drv_data->set_ios)
slot->host->drv_data->set_ios(slot->host, ios);
if (drv_data && drv_data->set_ios)
drv_data->set_ios(slot->host, ios);

switch (ios->power_mode) {
case MMC_POWER_UP:
Expand Down Expand Up @@ -1815,6 +1817,7 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
{
struct mmc_host *mmc;
struct dw_mci_slot *slot;
struct dw_mci_drv_data *drv_data = host->drv_data;
int ctrl_id, ret;
u8 bus_width;

Expand Down Expand Up @@ -1854,8 +1857,8 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
} else {
ctrl_id = to_platform_device(host->dev)->id;
}
if (host->drv_data && host->drv_data->caps)
mmc->caps |= host->drv_data->caps[ctrl_id];
if (drv_data && drv_data->caps)
mmc->caps |= drv_data->caps[ctrl_id];

if (host->pdata->caps2)
mmc->caps2 = host->pdata->caps2;
Expand All @@ -1867,10 +1870,10 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id)
else
bus_width = 1;

if (host->drv_data->setup_bus) {
if (drv_data && drv_data->setup_bus) {
struct device_node *slot_np;
slot_np = dw_mci_of_find_slot_node(host->dev, slot->id);
ret = host->drv_data->setup_bus(host, slot_np, bus_width);
ret = drv_data->setup_bus(host, slot_np, bus_width);
if (ret)
goto err_setup_bus;
}
Expand Down Expand Up @@ -2035,6 +2038,7 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
struct dw_mci_board *pdata;
struct device *dev = host->dev;
struct device_node *np = dev->of_node;
struct dw_mci_drv_data *drv_data = host->drv_data;
int idx, ret;

pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
Expand Down Expand Up @@ -2062,8 +2066,8 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)

of_property_read_u32(np, "card-detect-delay", &pdata->detect_delay_ms);

if (host->drv_data->parse_dt) {
ret = host->drv_data->parse_dt(host);
if (drv_data && drv_data->parse_dt) {
ret = drv_data->parse_dt(host);
if (ret)
return ERR_PTR(ret);
}
Expand All @@ -2080,6 +2084,7 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)

int dw_mci_probe(struct dw_mci *host)
{
struct dw_mci_drv_data *drv_data = host->drv_data;
int width, i, ret = 0;
u32 fifo_size;
int init_slots = 0;
Expand Down Expand Up @@ -2127,8 +2132,8 @@ int dw_mci_probe(struct dw_mci *host)
else
host->bus_hz = clk_get_rate(host->ciu_clk);

if (host->drv_data->setup_clock) {
ret = host->drv_data->setup_clock(host);
if (drv_data && drv_data->setup_clock) {
ret = drv_data->setup_clock(host);
if (ret) {
dev_err(host->dev,
"implementation specific clock setup failed\n");
Expand Down

0 comments on commit e5abe2a

Please sign in to comment.