Skip to content

Commit

Permalink
sdhci: remove custom controller name
Browse files Browse the repository at this point in the history
Remove the use of the sdhci specific device name and use the mmc controller
name instead.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
  • Loading branch information
Pierre Ossman committed Apr 18, 2008
1 parent ff3112f commit b69c905
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 32 deletions.
44 changes: 16 additions & 28 deletions drivers/mmc/host/sdhci.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* linux/drivers/mmc/host/sdhci.c - Secure Digital Host Controller Interface driver
*
* Copyright (C) 2005-2007 Pierre Ossman, All Rights Reserved.
* Copyright (C) 2005-2008 Pierre Ossman, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -30,10 +30,6 @@

static unsigned int debug_quirks = 0;

/* For multi controllers in one platform case */
static u16 chip_index = 0;
static spinlock_t index_lock;

/*
* Different quirks to handle when the hardware deviates from a strict
* interpretation of the SDHCI specification.
Expand Down Expand Up @@ -1105,7 +1101,8 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id)
goto out;
}

DBG("*** %s got interrupt: 0x%08x\n", host->slot_descr, intmask);
DBG("*** %s got interrupt: 0x%08x\n",
mmc_hostname(host->mmc), intmask);

if (intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)) {
writel(intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE),
Expand Down Expand Up @@ -1235,7 +1232,7 @@ static int sdhci_resume (struct pci_dev *pdev)
if (chip->hosts[i]->flags & SDHCI_USE_DMA)
pci_set_master(pdev);
ret = request_irq(chip->hosts[i]->irq, sdhci_irq,
IRQF_SHARED, chip->hosts[i]->slot_descr,
IRQF_SHARED, mmc_hostname(chip->hosts[i]->mmc),
chip->hosts[i]);
if (ret)
return ret;
Expand Down Expand Up @@ -1324,9 +1321,7 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)

DBG("slot %d at 0x%08lx, irq %d\n", slot, host->addr, host->irq);

snprintf(host->slot_descr, 20, "sdhc%d:slot%d", chip->index, slot);

ret = pci_request_region(pdev, host->bar, host->slot_descr);
ret = pci_request_region(pdev, host->bar, mmc_hostname(mmc));
if (ret)
goto free;

Expand All @@ -1343,7 +1338,7 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
version = (version & SDHCI_SPEC_VER_MASK) >> SDHCI_SPEC_VER_SHIFT;
if (version > 1) {
printk(KERN_ERR "%s: Unknown controller version (%d). "
"You may experience problems.\n", host->slot_descr,
"You may experience problems.\n", mmc_hostname(mmc),
version);
}

Expand All @@ -1366,13 +1361,13 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
(host->flags & SDHCI_USE_DMA)) {
printk(KERN_WARNING "%s: Will use DMA "
"mode even though HW doesn't fully "
"claim to support it.\n", host->slot_descr);
"claim to support it.\n", mmc_hostname(mmc));
}

if (host->flags & SDHCI_USE_DMA) {
if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
printk(KERN_WARNING "%s: No suitable DMA available. "
"Falling back to PIO.\n", host->slot_descr);
"Falling back to PIO.\n", mmc_hostname(mmc));
host->flags &= ~SDHCI_USE_DMA;
}
}
Expand All @@ -1386,7 +1381,7 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
(caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT;
if (host->max_clk == 0) {
printk(KERN_ERR "%s: Hardware doesn't specify base clock "
"frequency.\n", host->slot_descr);
"frequency.\n", mmc_hostname(mmc));
ret = -ENODEV;
goto unmap;
}
Expand All @@ -1396,7 +1391,7 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
(caps & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT;
if (host->timeout_clk == 0) {
printk(KERN_ERR "%s: Hardware doesn't specify timeout clock "
"frequency.\n", host->slot_descr);
"frequency.\n", mmc_hostname(mmc));
ret = -ENODEV;
goto unmap;
}
Expand Down Expand Up @@ -1424,7 +1419,7 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)

if (mmc->ocr_avail == 0) {
printk(KERN_ERR "%s: Hardware doesn't report any "
"support voltages.\n", host->slot_descr);
"support voltages.\n", mmc_hostname(mmc));
ret = -ENODEV;
goto unmap;
}
Expand Down Expand Up @@ -1458,8 +1453,8 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
*/
mmc->max_blk_size = (caps & SDHCI_MAX_BLOCK_MASK) >> SDHCI_MAX_BLOCK_SHIFT;
if (mmc->max_blk_size >= 3) {
printk(KERN_WARNING "%s: Invalid maximum block size, assuming 512\n",
host->slot_descr);
printk(KERN_WARNING "%s: Invalid maximum block size, "
"assuming 512 bytes\n", mmc_hostname(mmc));
mmc->max_blk_size = 512;
} else
mmc->max_blk_size = 512 << mmc->max_blk_size;
Expand All @@ -1480,7 +1475,7 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
setup_timer(&host->timer, sdhci_timeout_timer, (unsigned long)host);

ret = request_irq(host->irq, sdhci_irq, IRQF_SHARED,
host->slot_descr, host);
mmc_hostname(mmc), host);
if (ret)
goto untasklet;

Expand All @@ -1494,8 +1489,8 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)

mmc_add_host(mmc);

printk(KERN_INFO "%s: SDHCI at 0x%08lx irq %d %s\n", mmc_hostname(mmc),
host->addr, host->irq,
printk(KERN_INFO "%s: SDHCI at 0x%08lx irq %d %s\n",
mmc_hostname(mmc), host->addr, host->irq,
(host->flags & SDHCI_USE_DMA)?"DMA":"PIO");

return 0;
Expand Down Expand Up @@ -1589,11 +1584,6 @@ static int __devinit sdhci_probe(struct pci_dev *pdev,
chip->num_slots = slots;
pci_set_drvdata(pdev, chip);

/* Add for multi controller case */
spin_lock(&index_lock);
chip->index = chip_index++;
spin_unlock(&index_lock);

for (i = 0;i < slots;i++) {
ret = sdhci_probe_slot(pdev, i);
if (ret) {
Expand Down Expand Up @@ -1654,8 +1644,6 @@ static int __init sdhci_drv_init(void)
": Secure Digital Host Controller Interface driver\n");
printk(KERN_INFO DRIVER_NAME ": Copyright(c) Pierre Ossman\n");

spin_lock_init(&index_lock);

return pci_register_driver(&sdhci_driver);
}

Expand Down
5 changes: 1 addition & 4 deletions drivers/mmc/host/sdhci.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* linux/drivers/mmc/host/sdhci.h - Secure Digital Host Controller Interface driver
*
* Copyright (C) 2005-2007 Pierre Ossman, All Rights Reserved.
* Copyright (C) 2005-2008 Pierre Ossman, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -190,8 +190,6 @@ struct sdhci_host {
int offset; /* Offset into current sg */
int remain; /* Bytes left in current */

char slot_descr[20]; /* Name for reservations */

int irq; /* Device IRQ */
int bar; /* PCI BAR index */
unsigned long addr; /* Bus address */
Expand All @@ -208,7 +206,6 @@ struct sdhci_chip {

unsigned long quirks;

int index; /* Index for chip0, chip1 ...*/
int num_slots; /* Slots on controller */
struct sdhci_host *hosts[0]; /* Pointers to hosts */
};

0 comments on commit b69c905

Please sign in to comment.