Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106390
b: refs/heads/master
c: c5d5e9c
h: refs/heads/master
v: v3
  • Loading branch information
Paulius Zaleckas authored and Pierre Ossman committed Jul 26, 2008
1 parent d0affe6 commit e0a7a55
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 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: 5fc63dfba8a016caf832572aeaa90abef82f0ba0
refs/heads/master: c5d5e9c40fc6cabedd5fdc7441e6e9d37f5c9bba
11 changes: 9 additions & 2 deletions trunk/drivers/mmc/host/imxmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,8 @@ static void imxmci_check_status(unsigned long data)
{
struct imxmci_host *host = (struct imxmci_host *)data;

if( host->pdata->card_present(mmc_dev(host->mmc)) != host->present ) {
if (host->pdata && host->pdata->card_present &&
host->pdata->card_present(mmc_dev(host->mmc)) != host->present) {
host->present ^= 1;
dev_info(mmc_dev(host->mmc), "card %s\n",
host->present ? "inserted" : "removed");
Expand Down Expand Up @@ -968,6 +969,8 @@ static int imxmci_probe(struct platform_device *pdev)
host->mmc = mmc;
host->dma_allocated = 0;
host->pdata = pdev->dev.platform_data;
if (!host->pdata)
dev_warn(&pdev->dev, "No platform data provided!\n");

spin_lock_init(&host->lock);
host->res = r;
Expand Down Expand Up @@ -1020,7 +1023,11 @@ static int imxmci_probe(struct platform_device *pdev)
if (ret)
goto out;

host->present = host->pdata->card_present(mmc_dev(mmc));
if (host->pdata && host->pdata->card_present)
host->present = host->pdata->card_present(mmc_dev(mmc));
else /* if there is no way to detect assume that card is present */
host->present = 1;

init_timer(&host->timer);
host->timer.data = (unsigned long)host;
host->timer.function = imxmci_check_status;
Expand Down

0 comments on commit e0a7a55

Please sign in to comment.