diff options
author | Pierre Ossman <drzeus@drzeus.cx> | 2007-07-23 00:12:10 +0200 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2007-07-26 02:05:04 +0200 |
commit | 109b5bed18441599b5ab0e1f3623efa5715a4703 (patch) | |
tree | 67d71adcfad02633cb643b2bb3d51218dd2a3938 /drivers/mmc/core/bus.c | |
parent | 2986d0bf23d97d68804ccfa80965073ccf1af242 (diff) |
mmc: be more verbose about card insertions/removal
Let the user know that the kernel actually detected the card
by printing some basic information in dmesg.
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc/core/bus.c')
-rw-r--r-- | drivers/mmc/core/bus.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index 348b566bf4f..fe0e785ed7d 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c @@ -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); @@ -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); |