mmc: remove unused muti calc
authorlintao <lintao@rock-chips.com>
Thu, 4 Sep 2014 03:46:43 +0000 (11:46 +0800)
committerlintao <lintao@rock-chips.com>
Thu, 4 Sep 2014 03:48:17 +0000 (11:48 +0800)
drivers/mmc/host/rk_sdmmc.c

index 0238bb94e86f1510e2de4d0e71472eb6b6de4ec4..7e8d03653d2207d96fe148af81260c5f5d50ae91 100755 (executable)
@@ -2756,22 +2756,20 @@ host_put:
 
 static void dw_mci_cmd_interrupt(struct dw_mci *host, u32 status)
 {
-        u32 multi, unit;
+        u32 multi, unit = SZ_2M;
 
         if (!host->cmd_status)
            host->cmd_status = status;
            
-       if(!host->cmd)
+        if (!host->cmd)
                goto cmd_exit;
 
-       if((MMC_STOP_TRANSMISSION != host->cmd->opcode))
-        {
-                unit = 2*1024*1024;
-                multi = mci_readl(host, BYTCNT)/unit;
-                multi += ((mci_readl(host, BYTCNT) % unit) ? 1 :0 );
-                multi = (multi > 0) ? multi : 1;
-                multi += (host->cmd->retries > 2)? 2 : host->cmd->retries;
-                mod_timer(&host->dto_timer, jiffies + msecs_to_jiffies(4500 * multi));//max wait 8s larger
+        if ((MMC_STOP_TRANSMISSION != host->cmd->opcode)) {
+                multi = (mci_readl(host, BYTCNT) / unit) +
+                        ((mci_readl(host, BYTCNT) % unit) ? 1 :0 ) +
+                        ((host->cmd->retries > 2) ? 2 : host->cmd->retries);
+                /* Max limit time: 8s for dto */
+                mod_timer(&host->dto_timer, jiffies + msecs_to_jiffies(4000 * multi));
         }
 
 cmd_exit: