Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
[cascardo/linux.git] / drivers / scsi / seagate.c
index 4e6666c..b113244 100644 (file)
@@ -97,8 +97,8 @@
 #include <linux/blkdev.h>
 #include <linux/stat.h>
 #include <linux/delay.h>
+#include <linux/io.h>
 
-#include <asm/io.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
 
 #define DPRINTK( when, msg... ) do { if ( (DEBUG & (when)) == (when) ) printk( msg ); } while (0)
 #else
 #define DPRINTK( when, msg... ) do { } while (0)
+#define DEBUG 0
 #endif
 #define DANY( msg... ) DPRINTK( 0xffff, msg );
 
@@ -320,8 +321,8 @@ static Signature __initdata signatures[] = {
  */
 
 static int hostno = -1;
-static void seagate_reconnect_intr (int, void *, struct pt_regs *);
-static irqreturn_t do_seagate_reconnect_intr (int, void *, struct pt_regs *);
+static void seagate_reconnect_intr (int, void *);
+static irqreturn_t do_seagate_reconnect_intr (int, void *);
 static int seagate_st0x_bus_reset(struct scsi_cmnd *);
 
 #ifdef FAST
@@ -419,7 +420,7 @@ static inline void borken_wait (void)
 #define ULOOP( i ) for (clock = i*8;;)
 #define TIMEOUT (!(clock--))
 
-int __init seagate_st0x_detect (struct scsi_host_template * tpnt)
+static int __init seagate_st0x_detect (struct scsi_host_template * tpnt)
 {
        struct Scsi_Host *instance;
        int i, j;
@@ -523,7 +524,7 @@ int __init seagate_st0x_detect (struct scsi_host_template * tpnt)
 #ifdef ARBITRATE
                " ARBITRATE"
 #endif
-#ifdef DEBUG
+#if DEBUG
                " DEBUG"
 #endif
 #ifdef FAST
@@ -619,19 +620,18 @@ static int should_reconnect = 0;
  * asserting SEL.
  */
 
-static irqreturn_t do_seagate_reconnect_intr(int irq, void *dev_id,
-                                               struct pt_regs *regs)
+static irqreturn_t do_seagate_reconnect_intr(int irq, void *dev_id)
 {
        unsigned long flags;
        struct Scsi_Host *dev = dev_id;
        
        spin_lock_irqsave (dev->host_lock, flags);
-       seagate_reconnect_intr (irq, dev_id, regs);
+       seagate_reconnect_intr (irq, dev_id);
        spin_unlock_irqrestore (dev->host_lock, flags);
        return IRQ_HANDLED;
 }
 
-static void seagate_reconnect_intr (int irq, void *dev_id, struct pt_regs *regs)
+static void seagate_reconnect_intr (int irq, void *dev_id)
 {
        int temp;
        struct scsi_cmnd *SCtmp;
@@ -734,7 +734,7 @@ static int internal_command (unsigned char target, unsigned char lun,
        unsigned char *data = NULL;
        struct scatterlist *buffer = NULL;
        int clock, temp, nobuffs = 0, done = 0, len = 0;
-#ifdef DEBUG
+#if DEBUG
        int transfered = 0, phase = 0, newphase;
 #endif
        register unsigned char status_read;
@@ -999,14 +999,14 @@ connect_loop:
                                for (i = 0; i < nobuffs; ++i)
                                        printk("scsi%d : buffer %d address = %p length = %d\n",
                                             hostno, i,
-                                            page_address(buffer[i].page) + buffer[i].offset,
+                                            sg_virt(&buffer[i]),
                                             buffer[i].length);
                        }
 #endif
 
                        buffer = (struct scatterlist *) SCint->request_buffer;
                        len = buffer->length;
-                       data = page_address(buffer->page) + buffer->offset;
+                       data = sg_virt(buffer);
                } else {
                        DPRINTK (DEBUG_SG, "scsi%d : scatter gather not requested.\n", hostno);
                        buffer = NULL;
@@ -1239,7 +1239,7 @@ connect_loop:
                                        --nobuffs;
                                        ++buffer;
                                        len = buffer->length;
-                                       data = page_address(buffer->page) + buffer->offset;
+                                       data = sg_virt(buffer);
                                        DPRINTK (DEBUG_SG,
                                                 "scsi%d : next scatter-gather buffer len = %d address = %08x\n",
                                                 hostno, len, data);
@@ -1396,7 +1396,7 @@ connect_loop:
                                        --nobuffs;
                                        ++buffer;
                                        len = buffer->length;
-                                       data = page_address(buffer->page) + buffer->offset;
+                                       data = sg_virt(buffer);
                                        DPRINTK (DEBUG_SG, "scsi%d : next scatter-gather buffer len = %d address = %08x\n", hostno, len, data);
                                }
                                break;