Skip to content

Commit

Permalink
[MMC] sdhci: check SDHCI base clock
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pierre Ossman authored and Russell King committed Jul 2, 2006
1 parent d63fb6c commit 8ef1a14
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions drivers/mmc/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand Down Expand Up @@ -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);

Expand All @@ -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);
Expand Down

0 comments on commit 8ef1a14

Please sign in to comment.