]> err.no Git - linux-2.6/blobdiff - drivers/mmc/mmci.c
[PATCH] Fix I2O config-osm init to return proper error
[linux-2.6] / drivers / mmc / mmci.c
index 3ee961c206bd8dfb5bd209287c4fb9203e73e122..91c74843dc0d8c54c88bec1973a44eda18b0866b 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/mmc/host.h>
 #include <linux/mmc/protocol.h>
 
+#include <asm/div64.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/scatterlist.h>
@@ -33,7 +34,7 @@
 
 #ifdef CONFIG_MMC_DEBUG
 #define DBG(host,fmt,args...)  \
-       pr_debug("%s: %s: " fmt, host->mmc->host_name, __func__ , args)
+       pr_debug("%s: %s: " fmt, mmc_hostname(host->mmc), __func__ , args)
 #else
 #define DBG(host,fmt,args...)  do { } while (0)
 #endif
@@ -70,6 +71,7 @@ static void mmci_stop_data(struct mmci_host *host)
 static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
 {
        unsigned int datactrl, timeout, irqmask;
+       unsigned long long clks;
        void __iomem *base;
 
        DBG(host, "blksz %04x blks %04x flags %08x\n",
@@ -81,9 +83,10 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
 
        mmci_init_sg(host, data);
 
-       timeout = data->timeout_clks +
-                 ((unsigned long long)data->timeout_ns * host->cclk) /
-                  1000000000ULL;
+       clks = (unsigned long long)data->timeout_ns * host->cclk;
+       do_div(clks, 1000000000UL);
+
+       timeout = data->timeout_clks + (unsigned int)clks;
 
        base = host->base;
        writel(timeout, base + MMCIDATATIMER);
@@ -439,7 +442,7 @@ static void mmci_check_status(unsigned long data)
 
        status = host->plat->status(mmc_dev(host->mmc));
        if (status ^ host->oldstat)
-               mmc_detect_change(host->mmc);
+               mmc_detect_change(host->mmc, 0);
 
        host->oldstat = status;
        mod_timer(&host->timer, jiffies + HZ);
@@ -538,7 +541,7 @@ static int mmci_probe(struct amba_device *dev, void *id)
        mmc_add_host(mmc);
 
        printk(KERN_INFO "%s: MMCI rev %x cfg %02x at 0x%08lx irq %d,%d\n",
-               mmc->host_name, amba_rev(dev), amba_config(dev),
+               mmc_hostname(mmc), amba_rev(dev), amba_config(dev),
                dev->res.start, dev->irq[0], dev->irq[1]);
 
        init_timer(&host->timer);
@@ -603,7 +606,7 @@ static int mmci_remove(struct amba_device *dev)
 }
 
 #ifdef CONFIG_PM
-static int mmci_suspend(struct amba_device *dev, u32 state)
+static int mmci_suspend(struct amba_device *dev, pm_message_t state)
 {
        struct mmc_host *mmc = amba_get_drvdata(dev);
        int ret = 0;