diff options
author | Pierre Ossman <drzeus@drzeus.cx> | 2006-06-30 05:22:21 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-07-02 11:01:59 -0400 |
commit | 8ef1a14379e105c1419d21e96ffac53202bc0501 (patch) | |
tree | 695548d0cd542e135634eab88d811b0b6e29ed3a /drivers/mmc/sdhci.c | |
parent | d63fb6c55f5f9eb3032fc5c3ab6eb9a26dd67cdc (diff) |
[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.c | 15 |
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) | |||
1030 | else /* XXX: Hack to get MMC layer to avoid highmem */ | 1030 | else /* XXX: Hack to get MMC layer to avoid highmem */ |
1031 | pdev->dma_mask = 0; | 1031 | pdev->dma_mask = 0; |
1032 | 1032 | ||
1033 | host->max_clk = (caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT; | 1033 | host->max_clk = |
1034 | (caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT; | ||
1035 | if (host->max_clk == 0) { | ||
1036 | printk(KERN_ERR "%s: Hardware doesn't specify base clock " | ||
1037 | "frequency.\n", host->slot_descr); | ||
1038 | ret = -ENODEV; | ||
1039 | goto unmap; | ||
1040 | } | ||
1034 | host->max_clk *= 1000000; | 1041 | host->max_clk *= 1000000; |
1035 | 1042 | ||
1036 | /* | 1043 | /* |
@@ -1078,7 +1085,7 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot) | |||
1078 | ret = request_irq(host->irq, sdhci_irq, SA_SHIRQ, | 1085 | ret = request_irq(host->irq, sdhci_irq, SA_SHIRQ, |
1079 | host->slot_descr, host); | 1086 | host->slot_descr, host); |
1080 | if (ret) | 1087 | if (ret) |
1081 | goto unmap; | 1088 | goto untasklet; |
1082 | 1089 | ||
1083 | sdhci_init(host); | 1090 | sdhci_init(host); |
1084 | 1091 | ||
@@ -1097,10 +1104,10 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot) | |||
1097 | 1104 | ||
1098 | return 0; | 1105 | return 0; |
1099 | 1106 | ||
1100 | unmap: | 1107 | untasklet: |
1101 | tasklet_kill(&host->card_tasklet); | 1108 | tasklet_kill(&host->card_tasklet); |
1102 | tasklet_kill(&host->finish_tasklet); | 1109 | tasklet_kill(&host->finish_tasklet); |
1103 | 1110 | unmap: | |
1104 | iounmap(host->ioaddr); | 1111 | iounmap(host->ioaddr); |
1105 | release: | 1112 | release: |
1106 | pci_release_region(pdev, host->bar); | 1113 | pci_release_region(pdev, host->bar); |