From b69c9058907642f8e1b32076906755c6623ea060 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Sat, 8 Mar 2008 23:44:25 +0100 Subject: sdhci: remove custom controller name Remove the use of the sdhci specific device name and use the mmc controller name instead. Signed-off-by: Pierre Ossman diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 4b673aa..71e020d 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -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 @@ -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. @@ -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), @@ -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; @@ -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; @@ -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); } @@ -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; } } @@ -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; } @@ -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; } @@ -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; } @@ -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; @@ -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; @@ -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; @@ -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) { @@ -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); } diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index d5a38f1..3288e209 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -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 @@ -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 */ @@ -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 */ }; -- cgit v0.10.2