Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/drzeus/mmc:
  mmc: struct device - replace bus_id with dev_name(), dev_set_name()
  mmc: increase SD write timeout for crappy cards
This commit is contained in:
Linus Torvalds 2008-11-09 11:14:16 -08:00
commit 02cabab4a8
10 changed files with 22 additions and 21 deletions

View File

@ -216,8 +216,7 @@ int mmc_add_card(struct mmc_card *card)
int ret; int ret;
const char *type; const char *type;
snprintf(card->dev.bus_id, sizeof(card->dev.bus_id), dev_set_name(&card->dev, "%s:%04x", mmc_hostname(card->host), card->rca);
"%s:%04x", mmc_hostname(card->host), card->rca);
switch (card->type) { switch (card->type) {
case MMC_TYPE_MMC: case MMC_TYPE_MMC:

View File

@ -280,7 +280,11 @@ void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card)
(card->host->ios.clock / 1000); (card->host->ios.clock / 1000);
if (data->flags & MMC_DATA_WRITE) if (data->flags & MMC_DATA_WRITE)
limit_us = 250000; /*
* The limit is really 250 ms, but that is
* insufficient for some crappy cards.
*/
limit_us = 300000;
else else
limit_us = 100000; limit_us = 100000;

View File

@ -73,8 +73,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev)
if (err) if (err)
goto free; goto free;
snprintf(host->class_dev.bus_id, BUS_ID_SIZE, dev_set_name(&host->class_dev, "mmc%d", host->index);
"mmc%d", host->index);
host->parent = dev; host->parent = dev;
host->class_dev.parent = dev; host->class_dev.parent = dev;
@ -121,7 +120,7 @@ int mmc_add_host(struct mmc_host *host)
WARN_ON((host->caps & MMC_CAP_SDIO_IRQ) && WARN_ON((host->caps & MMC_CAP_SDIO_IRQ) &&
!host->ops->enable_sdio_irq); !host->ops->enable_sdio_irq);
led_trigger_register_simple(host->class_dev.bus_id, &host->led); led_trigger_register_simple(dev_name(&host->class_dev), &host->led);
err = device_add(&host->class_dev); err = device_add(&host->class_dev);
if (err) if (err)

View File

@ -239,8 +239,7 @@ int sdio_add_func(struct sdio_func *func)
{ {
int ret; int ret;
snprintf(func->dev.bus_id, sizeof(func->dev.bus_id), dev_set_name(&func->dev, "%s:%d", mmc_card_id(func->card), func->num);
"%s:%d", mmc_card_id(func->card), func->num);
ret = device_add(&func->dev); ret = device_add(&func->dev);
if (ret == 0) if (ret == 0)

View File

@ -1348,7 +1348,7 @@ static int mmc_spi_probe(struct spi_device *spi)
goto fail_add_host; goto fail_add_host;
dev_info(&spi->dev, "SD/MMC host %s%s%s%s%s\n", dev_info(&spi->dev, "SD/MMC host %s%s%s%s%s\n",
mmc->class_dev.bus_id, dev_name(&mmc->class_dev),
host->dma_dev ? "" : ", no DMA", host->dma_dev ? "" : ", no DMA",
(host->pdata && host->pdata->get_ro) (host->pdata && host->pdata->get_ro)
? "" : ", no WP", ? "" : ", no WP",

View File

@ -1733,7 +1733,7 @@ int sdhci_add_host(struct sdhci_host *host)
mmc_add_host(mmc); mmc_add_host(mmc);
printk(KERN_INFO "%s: SDHCI controller on %s [%s] using %s%s\n", printk(KERN_INFO "%s: SDHCI controller on %s [%s] using %s%s\n",
mmc_hostname(mmc), host->hw_name, mmc_dev(mmc)->bus_id, mmc_hostname(mmc), host->hw_name, dev_name(mmc_dev(mmc)),
(host->flags & SDHCI_USE_ADMA)?"A":"", (host->flags & SDHCI_USE_ADMA)?"A":"",
(host->flags & SDHCI_USE_DMA)?"DMA":"PIO"); (host->flags & SDHCI_USE_DMA)?"DMA":"PIO");

View File

@ -632,7 +632,7 @@ static void tifm_sd_request(struct mmc_host *mmc, struct mmc_request *mrq)
if (host->req) { if (host->req) {
printk(KERN_ERR "%s : unfinished request detected\n", printk(KERN_ERR "%s : unfinished request detected\n",
sock->dev.bus_id); dev_name(&sock->dev));
mrq->cmd->error = -ETIMEDOUT; mrq->cmd->error = -ETIMEDOUT;
goto err_out; goto err_out;
} }
@ -672,7 +672,7 @@ static void tifm_sd_request(struct mmc_host *mmc, struct mmc_request *mrq)
? PCI_DMA_TODEVICE ? PCI_DMA_TODEVICE
: PCI_DMA_FROMDEVICE)) { : PCI_DMA_FROMDEVICE)) {
printk(KERN_ERR "%s : scatterlist map failed\n", printk(KERN_ERR "%s : scatterlist map failed\n",
sock->dev.bus_id); dev_name(&sock->dev));
mrq->cmd->error = -ENOMEM; mrq->cmd->error = -ENOMEM;
goto err_out; goto err_out;
} }
@ -684,7 +684,7 @@ static void tifm_sd_request(struct mmc_host *mmc, struct mmc_request *mrq)
: PCI_DMA_FROMDEVICE); : PCI_DMA_FROMDEVICE);
if (host->sg_len < 1) { if (host->sg_len < 1) {
printk(KERN_ERR "%s : scatterlist map failed\n", printk(KERN_ERR "%s : scatterlist map failed\n",
sock->dev.bus_id); dev_name(&sock->dev));
tifm_unmap_sg(sock, &host->bounce_buf, 1, tifm_unmap_sg(sock, &host->bounce_buf, 1,
r_data->flags & MMC_DATA_WRITE r_data->flags & MMC_DATA_WRITE
? PCI_DMA_TODEVICE ? PCI_DMA_TODEVICE
@ -748,7 +748,7 @@ static void tifm_sd_end_cmd(unsigned long data)
if (!mrq) { if (!mrq) {
printk(KERN_ERR " %s : no request to complete?\n", printk(KERN_ERR " %s : no request to complete?\n",
sock->dev.bus_id); dev_name(&sock->dev));
spin_unlock_irqrestore(&sock->lock, flags); spin_unlock_irqrestore(&sock->lock, flags);
return; return;
} }
@ -789,7 +789,7 @@ static void tifm_sd_abort(unsigned long data)
printk(KERN_ERR printk(KERN_ERR
"%s : card failed to respond for a long period of time " "%s : card failed to respond for a long period of time "
"(%x, %x)\n", "(%x, %x)\n",
host->dev->dev.bus_id, host->req->cmd->opcode, host->cmd_flags); dev_name(&host->dev->dev), host->req->cmd->opcode, host->cmd_flags);
tifm_eject(host->dev); tifm_eject(host->dev);
} }
@ -906,7 +906,7 @@ static int tifm_sd_initialize_host(struct tifm_sd *host)
if (rc) { if (rc) {
printk(KERN_ERR "%s : controller failed to reset\n", printk(KERN_ERR "%s : controller failed to reset\n",
sock->dev.bus_id); dev_name(&sock->dev));
return -ENODEV; return -ENODEV;
} }
@ -933,7 +933,7 @@ static int tifm_sd_initialize_host(struct tifm_sd *host)
if (rc) { if (rc) {
printk(KERN_ERR printk(KERN_ERR
"%s : card not ready - probe failed on initialization\n", "%s : card not ready - probe failed on initialization\n",
sock->dev.bus_id); dev_name(&sock->dev));
return -ENODEV; return -ENODEV;
} }
@ -954,7 +954,7 @@ static int tifm_sd_probe(struct tifm_dev *sock)
if (!(TIFM_SOCK_STATE_OCCUPIED if (!(TIFM_SOCK_STATE_OCCUPIED
& readl(sock->addr + SOCK_PRESENT_STATE))) { & readl(sock->addr + SOCK_PRESENT_STATE))) {
printk(KERN_WARNING "%s : card gone, unexpectedly\n", printk(KERN_WARNING "%s : card gone, unexpectedly\n",
sock->dev.bus_id); dev_name(&sock->dev));
return rc; return rc;
} }

View File

@ -130,7 +130,7 @@ struct mmc_card {
#define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR)
#define mmc_card_name(c) ((c)->cid.prod_name) #define mmc_card_name(c) ((c)->cid.prod_name)
#define mmc_card_id(c) ((c)->dev.bus_id) #define mmc_card_id(c) (dev_name(&(c)->dev))
#define mmc_list_to_card(l) container_of(l, struct mmc_card, node) #define mmc_list_to_card(l) container_of(l, struct mmc_card, node)
#define mmc_get_drvdata(c) dev_get_drvdata(&(c)->dev) #define mmc_get_drvdata(c) dev_get_drvdata(&(c)->dev)

View File

@ -176,7 +176,7 @@ static inline void *mmc_priv(struct mmc_host *host)
#define mmc_dev(x) ((x)->parent) #define mmc_dev(x) ((x)->parent)
#define mmc_classdev(x) (&(x)->class_dev) #define mmc_classdev(x) (&(x)->class_dev)
#define mmc_hostname(x) ((x)->class_dev.bus_id) #define mmc_hostname(x) (dev_name(&(x)->class_dev))
extern int mmc_suspend_host(struct mmc_host *, pm_message_t); extern int mmc_suspend_host(struct mmc_host *, pm_message_t);
extern int mmc_resume_host(struct mmc_host *); extern int mmc_resume_host(struct mmc_host *);

View File

@ -63,7 +63,7 @@ struct sdio_func {
#define sdio_func_set_present(f) ((f)->state |= SDIO_STATE_PRESENT) #define sdio_func_set_present(f) ((f)->state |= SDIO_STATE_PRESENT)
#define sdio_func_id(f) ((f)->dev.bus_id) #define sdio_func_id(f) (dev_name(&(f)->dev))
#define sdio_get_drvdata(f) dev_get_drvdata(&(f)->dev) #define sdio_get_drvdata(f) dev_get_drvdata(&(f)->dev)
#define sdio_set_drvdata(f,d) dev_set_drvdata(&(f)->dev, d) #define sdio_set_drvdata(f,d) dev_set_drvdata(&(f)->dev, d)