Merge branches 'release', 'asus', 'sony-laptop' and 'thinkpad' into release
[pandora-kernel.git] / drivers / scsi / a2091.c
index 0854069..5ac3a3e 100644 (file)
@@ -1,7 +1,6 @@
 #include <linux/types.h>
 #include <linux/mm.h>
 #include <linux/blkdev.h>
-#include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 
@@ -24,7 +23,7 @@
 #define DMA(ptr) ((a2091_scsiregs *)((ptr)->base))
 #define HDATA(ptr) ((struct WD33C93_hostdata *)((ptr)->hostdata))
 
-static irqreturn_t a2091_intr (int irq, void *_instance, struct pt_regs *fp)
+static irqreturn_t a2091_intr (int irq, void *_instance)
 {
     unsigned long flags;
     unsigned int status;
@@ -47,8 +46,7 @@ static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
     struct Scsi_Host *instance = cmd->device->host;
 
     /* don't allow DMA if the physical address is bad */
-    if (addr & A2091_XFER_MASK ||
-       (!dir_in && mm_end_of_chunk (addr, cmd->SCp.this_residual)))
+    if (addr & A2091_XFER_MASK)
     {
        HDATA(instance)->dma_bounce_len = (cmd->SCp.this_residual + 511)
            & ~0x1ff;
@@ -74,18 +72,9 @@ static int dma_setup(struct scsi_cmnd *cmd, int dir_in)
        }
 
        if (!dir_in) {
-           /* copy to bounce buffer for a write */
-           if (cmd->use_sg)
-#if 0
-               panic ("scsi%ddma: incomplete s/g support",
-                      instance->host_no);
-#else
+               /* copy to bounce buffer for a write */
                memcpy (HDATA(instance)->dma_bounce_buffer,
                        cmd->SCp.ptr, cmd->SCp.this_residual);
-#endif
-           else
-               memcpy (HDATA(instance)->dma_bounce_buffer,
-                       cmd->request_buffer, cmd->request_bufflen);
        }
     }
 
@@ -145,30 +134,13 @@ static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt,
 
     /* copy from a bounce buffer, if necessary */
     if (status && HDATA(instance)->dma_bounce_buffer) {
-       if (SCpnt && SCpnt->use_sg) {
-#if 0
-           panic ("scsi%d: incomplete s/g support",
-                  instance->host_no);
-#else
-           if( HDATA(instance)->dma_dir )
+       if( HDATA(instance)->dma_dir )
                memcpy (SCpnt->SCp.ptr, 
                        HDATA(instance)->dma_bounce_buffer,
                        SCpnt->SCp.this_residual);
-           kfree (HDATA(instance)->dma_bounce_buffer);
-           HDATA(instance)->dma_bounce_buffer = NULL;
-           HDATA(instance)->dma_bounce_len = 0;
-           
-#endif
-       } else {
-           if (HDATA(instance)->dma_dir && SCpnt)
-               memcpy (SCpnt->request_buffer,
-                       HDATA(instance)->dma_bounce_buffer,
-                       SCpnt->request_bufflen);
-
-           kfree (HDATA(instance)->dma_bounce_buffer);
-           HDATA(instance)->dma_bounce_buffer = NULL;
-           HDATA(instance)->dma_bounce_len = 0;
-       }
+       kfree (HDATA(instance)->dma_bounce_buffer);
+       HDATA(instance)->dma_bounce_buffer = NULL;
+       HDATA(instance)->dma_bounce_len = 0;
     }
 }