Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 63046
b: refs/heads/master
c: 109b5be
h: refs/heads/master
v: v3
  • Loading branch information
Pierre Ossman committed Jul 26, 2007
1 parent c79be9c commit 2028a89
Show file tree
Hide file tree
Showing 4 changed files with 36 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: 2986d0bf23d97d68804ccfa80965073ccf1af242
refs/heads/master: 109b5bed18441599b5ab0e1f3623efa5715a4703
23 changes: 23 additions & 0 deletions trunk/drivers/mmc/core/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,30 @@ struct mmc_card *mmc_alloc_card(struct mmc_host *host)
int mmc_add_card(struct mmc_card *card)
{
int ret;
const char *type;

snprintf(card->dev.bus_id, sizeof(card->dev.bus_id),
"%s:%04x", mmc_hostname(card->host), card->rca);

switch (card->type) {
case MMC_TYPE_MMC:
type = "MMC";
break;
case MMC_TYPE_SD:
type = "SD";
if (mmc_card_blockaddr(card))
type = "SDHC";
break;
default:
type = "?";
break;
}

printk(KERN_INFO "%s: new %s%s card at address %04x\n",
mmc_hostname(card->host),
mmc_card_highspeed(card) ? "high speed " : "",
type, card->rca);

card->dev.uevent_suppress = 1;

ret = device_add(&card->dev);
Expand Down Expand Up @@ -243,6 +263,9 @@ int mmc_add_card(struct mmc_card *card)
void mmc_remove_card(struct mmc_card *card)
{
if (mmc_card_present(card)) {
printk(KERN_INFO "%s: card %04x removed\n",
mmc_hostname(card->host), card->rca);

if (card->host->bus_ops->sysfs_remove)
card->host->bus_ops->sysfs_remove(card->host, card);
device_del(&card->dev);
Expand Down
7 changes: 6 additions & 1 deletion trunk/drivers/mmc/core/mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,10 @@ int mmc_attach_mmc(struct mmc_host *host, u32 ocr)
/*
* Can we support the voltage of the card?
*/
if (!host->ocr)
if (!host->ocr) {
err = -EINVAL;
goto err;
}

/*
* Detect and init the card.
Expand All @@ -582,6 +584,9 @@ int mmc_attach_mmc(struct mmc_host *host, u32 ocr)
mmc_detach_bus(host);
mmc_release_host(host);

printk(KERN_ERR "%s: error %d whilst initialising MMC card\n",
mmc_hostname(host), err);

return 0;
}

7 changes: 6 additions & 1 deletion trunk/drivers/mmc/core/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,10 @@ int mmc_attach_sd(struct mmc_host *host, u32 ocr)
/*
* Can we support the voltage(s) of the card(s)?
*/
if (!host->ocr)
if (!host->ocr) {
err = -EINVAL;
goto err;
}

/*
* Detect and init the card.
Expand All @@ -663,6 +665,9 @@ int mmc_attach_sd(struct mmc_host *host, u32 ocr)
mmc_detach_bus(host);
mmc_release_host(host);

printk(KERN_ERR "%s: error %d whilst initialising SD card\n",
mmc_hostname(host), err);

return 0;
}

0 comments on commit 2028a89

Please sign in to comment.