summaryrefslogtreecommitdiff
path: root/drivers/mmc/sdhci.c
diff options
context:
space:
mode:
authorPierre Ossman <drzeus@drzeus.cx>2006-06-30 13:22:21 +0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-07-02 19:01:59 +0400
commit8ef1a14379e105c1419d21e96ffac53202bc0501 (patch)
tree695548d0cd542e135634eab88d811b0b6e29ed3a /drivers/mmc/sdhci.c
parentd63fb6c55f5f9eb3032fc5c3ab6eb9a26dd67cdc (diff)
downloadlinux-8ef1a14379e105c1419d21e96ffac53202bc0501.tar.xz
[MMC] sdhci: check SDHCI base clock
A base clock value of 0 means that the driver must get the base clock through some other means. As we have no other way of getting it, we must abort. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/mmc/sdhci.c')
-rw-r--r--drivers/mmc/sdhci.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 8e9100bd57ef..0d9c327a84b0 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -1030,7 +1030,14 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
else /* XXX: Hack to get MMC layer to avoid highmem */
pdev->dma_mask = 0;
- host->max_clk = (caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT;
+ host->max_clk =
+ (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);
+ ret = -ENODEV;
+ goto unmap;
+ }
host->max_clk *= 1000000;
/*
@@ -1078,7 +1085,7 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
ret = request_irq(host->irq, sdhci_irq, SA_SHIRQ,
host->slot_descr, host);
if (ret)
- goto unmap;
+ goto untasklet;
sdhci_init(host);
@@ -1097,10 +1104,10 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
return 0;
-unmap:
+untasklet:
tasklet_kill(&host->card_tasklet);
tasklet_kill(&host->finish_tasklet);
-
+unmap:
iounmap(host->ioaddr);
release:
pci_release_region(pdev, host->bar);