Hi Thomas,

Thomas Chou wrote:
From: Jai Dhar <[EMAIL PROTECTED]>

Modified to use new errno scheme in MMC subsystem. Also now uses sg_virt
instead of sg_address to determine DMA address.

Signed-off-by: Jai Dhar <[EMAIL PROTECTED]>
Signed-off-by: Thomas Chou <[EMAIL PROTECTED]>

That looks better, applied, thanks.

Regards
Greg


 linux-2.6.x/drivers/mmc/host/nios_mmc.c |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/linux-2.6.x/drivers/mmc/host/nios_mmc.c 
b/linux-2.6.x/drivers/mmc/host/nios_mmc.c
index 89c2d9d..c72a6c4 100755
--- a/linux-2.6.x/drivers/mmc/host/nios_mmc.c
+++ b/linux-2.6.x/drivers/mmc/host/nios_mmc.c
@@ -17,6 +17,7 @@
 #include <linux/interrupt.h>
 #include <linux/dma-mapping.h>
 #include <linux/mmc/host.h>
+#include <linux/mmc/core.h>
 #include <linux/pagemap.h>
#include <asm/dma.h>
@@ -38,7 +39,7 @@
 }
 #else
 #define MMC_DEBUG(l,x...) {}
-#endif //CONFIG_MMC_DEBUG
+#endif /* CONFIG_MMC_DEBUG */
#define MMC_CRIT_ERR(x...) {\
        printk("Crit. error in %s(): %s. Halting\n",__func__,x);\
@@ -66,38 +67,38 @@ void nios_mmc_end_cmd(NIOS_MMC_HOST *host)
                while(1);
        }
        tmp = readl(host->base + NIOS_MMC_REG_CTLSTAT);
-       //Interrupt flags will be cleared in ISR routine, so we don't have to 
touch them */
+       /* Interrupt flags will be cleared in ISR routine, so we don't have to 
touch them */
        if (tmp & NIOS_MMC_CTLSTAT_TIMEOUTERR_IF)
        {
                MMC_DEBUG(1,"Timeout error\n");
-               ret = MMC_ERR_TIMEOUT;
+               ret = -ETIMEDOUT;
        }
        else if (tmp & NIOS_MMC_CTLSTAT_FRMERR_IF)
        {
                MMC_DEBUG(1,"Framing error\n");
-               ret = MMC_ERR_TIMEOUT;
+               ret = -EILSEQ;
        }
        else if (tmp & NIOS_MMC_CTLSTAT_CRCERR_IF)
        {
                MMC_DEBUG(1,"CRC Error\n");
-               ret = MMC_ERR_BADCRC;
+               ret = -EILSEQ;
        }
        else if (tmp & NIOS_MMC_CTLSTAT_FIFO_UNDERRUN_IF)
        {
                MMC_DEBUG(1,"FIFO Underrun error\n");
-               ret = MMC_ERR_BADCRC;
+               ret = -EINVAL;
        }
        else if (tmp & NIOS_MMC_CTLSTAT_FIFO_OVERRUN_IF)
        {
                MMC_DEBUG(1,"FIFO Overrun error\n");  
-               ret = MMC_ERR_BADCRC;
+               ret = -EINVAL;
        }
        else
        {
                /* Response is good! */
-               ret = MMC_ERR_NONE;
+               ret = 0;
        }
-       if (ret != MMC_ERR_NONE)
+       if (ret)
        {
                MMC_DEBUG(1,"Error executing CMD%d\n",cmd->opcode);
                MMC_DEBUG(2,"Response argument: 
0x%X\n",readl(host->base+NIOS_MMC_REG_CMD_ARG0));
@@ -115,7 +116,7 @@ void nios_mmc_end_cmd(NIOS_MMC_HOST *host)
        /* Check if this was a data transaction */
        if (data)
        {
-               if (cmd->error == MMC_ERR_NONE)
+               if (cmd->error == 0)
                        data->bytes_xfered = data->blksz*data->blocks;
                else data->bytes_xfered = 0;
        }
@@ -158,7 +159,7 @@ void nios_mmc_execute_cmd(NIOS_MMC_HOST *host, unsigned 
char cmd, unsigned int a
        cmdidx = (xfer_ctl >> NIOS_MMC_XFER_CTL_CMD_IDX_SHIFT)&0x3F;
        /* Setup DMA base */
        writel(buf | (1<<31), host->base + NIOS_MMC_REG_DMA_BASE);
-       MMC_DEBUG(2,"XFER_CTL: 0x%X (CMD%d), DMA_BASE(%c): 0x%X, ARG_IN: 
0x%X\n",
+       MMC_DEBUG(1,"XFER_CTL: 0x%X (CMD%d), DMA_BASE(%c): 0x%X, ARG_IN: 
0x%X\n",
                        xfer_ctl,cmdidx,
                        (xfer_ctl&NIOS_MMC_XFER_CTL_DAT_RWn)?'R':'W',buf, 
arg_in);
        /* Execute command */
@@ -217,7 +218,6 @@ static void nios_mmc_start_cmd(NIOS_MMC_HOST *host, struct 
mmc_command *cmd)
                        nocrc = 1;
                case MMC_RSP_R1:
                case MMC_RSP_R1B:
-               //case MMC_RSP_R6:
                        resp_type = 1;
                        break;
                case MMC_RSP_R2:
@@ -233,8 +233,8 @@ static void nios_mmc_start_cmd(NIOS_MMC_HOST *host, struct 
mmc_command *cmd)
        }
sg = data->sg;
-       current_address = sg_address(sg);
-       cmd->error = MMC_ERR_NONE;
+       current_address = (unsigned int) sg_virt(sg);
+       cmd->error = 0;
        if (data)
        {
                if (data->sg_len > 1)

--
------------------------------------------------------------------------
Greg Ungerer  --  Chief Software Dude       EMAIL:     [EMAIL PROTECTED]
Secure Computing Corporation                PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to