]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mmc/host/omap.c
Merge current mainline tree into linux-omap tree
[linux-2.6-omap-h63xx.git] / drivers / mmc / host / omap.c
index 0b59e9e86e31b9ed22c8104770552164e70f92f8..87dc63a9c725c0fb2114b36aa010a0d7a0ed50f2 100644 (file)
 #include <linux/mmc/host.h>
 #include <linux/mmc/card.h>
 #include <linux/clk.h>
+#include <linux/scatterlist.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
-#include <asm/scatterlist.h>
 #include <asm/mach-types.h>
 
 #include <asm/arch/board.h>
@@ -265,7 +265,7 @@ mmc_omap_xfer_done(struct mmc_omap_host *host, struct mmc_data *data)
                enum dma_data_direction dma_data_dir;
 
                BUG_ON(host->dma_ch < 0);
-               if (data->error != MMC_ERR_NONE)
+               if (data->error)
                        omap_stop_dma(host->dma_ch);
                /* Release DMA channel lazily */
                mod_timer(&host->dma_timer, jiffies + HZ);
@@ -370,7 +370,7 @@ mmc_omap_cmd_done(struct mmc_omap_host *host, struct mmc_command *cmd)
                }
        }
 
-       if (host->data == NULL || cmd->error != MMC_ERR_NONE) {
+       if (host->data == NULL || cmd->error) {
                host->mrq = NULL;
                clk_disable(host->fclk);
                mmc_request_done(host->mmc, cmd->mrq);
@@ -385,7 +385,7 @@ mmc_omap_sg_to_buf(struct mmc_omap_host *host)
 
        sg = host->data->sg + host->sg_idx;
        host->buffer_bytes_left = sg->length;
-       host->buffer = page_address(sg->page) + sg->offset;
+       host->buffer = sg_virt(sg);
        if (host->buffer_bytes_left > host->total_bytes_left)
                host->buffer_bytes_left = host->total_bytes_left;
 }
@@ -477,14 +477,14 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
                if (status & OMAP_MMC_STAT_DATA_TOUT) {
                        dev_dbg(mmc_dev(host->mmc), "data timeout\n");
                        if (host->data) {
-                               host->data->error |= MMC_ERR_TIMEOUT;
+                               host->data->error = -ETIMEDOUT;
                                transfer_error = 1;
                        }
                }
 
                if (status & OMAP_MMC_STAT_DATA_CRC) {
                        if (host->data) {
-                               host->data->error |= MMC_ERR_BADCRC;
+                               host->data->error = -EILSEQ;
                                dev_dbg(mmc_dev(host->mmc),
                                         "data CRC error, bytes left %d\n",
                                        host->total_bytes_left);
@@ -506,7 +506,7 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
                                        dev_err(mmc_dev(host->mmc),
                                                "command timeout, CMD %d\n",
                                                host->cmd->opcode);
-                               host->cmd->error = MMC_ERR_TIMEOUT;
+                               host->cmd->error = -ETIMEDOUT;
                                end_command = 1;
                        }
                }
@@ -516,7 +516,7 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
                                dev_err(mmc_dev(host->mmc),
                                        "command CRC error (CMD%d, arg 0x%08x)\n",
                                        host->cmd->opcode, host->cmd->arg);
-                               host->cmd->error = MMC_ERR_BADCRC;
+                               host->cmd->error = -EILSEQ;
                                end_command = 1;
                        } else
                                dev_err(mmc_dev(host->mmc),