]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: OMAP: Check for host->cmd being null when card status error occured
authorJarkko Lavinen <jarkko.lavinen@nokia.com>
Tue, 26 Jul 2005 07:51:46 +0000 (00:51 -0700)
committerTony Lindgren <tony@atomide.com>
Tue, 26 Jul 2005 07:51:46 +0000 (00:51 -0700)
Check for host->cmd being null when card status error occured.

Also, I think it is a bit more cleaner to put the STOP cmd workaround
handling under the general OMAP_MMC_STAT_CARD_ERR handling.

drivers/mmc/omap.c

index 862ab26cf94fa4130f25929c2c76ca4fc8d99060..a6b843369a6d9d3d43bcde4ba07705d6adb43518 100644 (file)
@@ -522,21 +522,19 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id, struct pt_regs *regs)
                        }
                }
 
-               if ((status & OMAP_MMC_STAT_CARD_ERR)
-                               && host->cmd->opcode == MMC_STOP_TRANSMISSION) {
-                       u32 response = OMAP_MMC_READ(host->base, RSP6)
+               if (status & OMAP_MMC_STAT_CARD_ERR) {
+                       if (host->cmd && host->cmd->opcode == MMC_STOP_TRANSMISSION) {
+                               u32 response = OMAP_MMC_READ(host->base, RSP6)
                                        | (OMAP_MMC_READ(host->base, RSP7) << 16);
-
-                       /* STOP sometimes sets must-ignore bits */
-                       if (!(response & (R1_CC_ERROR
-                                               | R1_ILLEGAL_COMMAND
-                                               | R1_COM_CRC_ERROR))) {
-                               status &= ~OMAP_MMC_STAT_CARD_ERR;
-                               end_command = 1;
+                               /* STOP sometimes sets must-ignore bits */
+                               if (!(response & (R1_CC_ERROR
+       | R1_ILLEGAL_COMMAND
+       | R1_COM_CRC_ERROR))) {
+                                       end_command = 1;
+                                       continue;
+                               }
                        }
-               }
 
-               if (status & OMAP_MMC_STAT_CARD_ERR) {
                        // Card status error
                        printk(KERN_DEBUG "MMC%d: Card status error (CMD%d)\n",
                               host->id, host->cmd->opcode);