Driver core: platform_driver_probe(), can save codespace
[safe/jmp/linux-2.6] / drivers / scsi / NCR5380.c
index cba9655..a6aa910 100644 (file)
@@ -87,6 +87,7 @@
  *      the high level code.
  */
 #include <scsi/scsi_dbg.h>
+#include <scsi/scsi_transport_spi.h>
 
 #ifndef NDEBUG
 #define NDEBUG 0
@@ -295,7 +296,7 @@ static __inline__ void initialize_SCp(Scsi_Cmnd * cmd)
         */
 
        if (cmd->use_sg) {
-               cmd->SCp.buffer = (struct scatterlist *) cmd->buffer;
+               cmd->SCp.buffer = (struct scatterlist *) cmd->request_buffer;
                cmd->SCp.buffers_residual = cmd->use_sg - 1;
                cmd->SCp.ptr = page_address(cmd->SCp.buffer->page)+
                               cmd->SCp.buffer->offset;
@@ -499,7 +500,7 @@ static void NCR5380_print_phase(struct Scsi_Host *instance)
 /* 
  * Function : int should_disconnect (unsigned char cmd)
  *
- * Purpose : decide weather a command would normally disconnect or 
+ * Purpose : decide whether a command would normally disconnect or 
  *      not, since if it won't disconnect we should go to sleep.
  *
  * Input : cmd - opcode of SCSI command
@@ -557,8 +558,7 @@ static int probe_irq __initdata = 0;
  *     used by the IRQ probe code.
  */
  
-static irqreturn_t __init probe_intr(int irq, void *dev_id,
-                                       struct pt_regs *regs)
+static irqreturn_t __init probe_intr(int irq, void *dev_id)
 {
        probe_irq = irq;
        return IRQ_HANDLED;
@@ -584,7 +584,7 @@ static int __init NCR5380_probe_irq(struct Scsi_Host *instance, int possible)
        NCR5380_setup(instance);
 
        for (trying_irqs = i = 0, mask = 1; i < 16; ++i, mask <<= 1)
-               if ((mask & possible) && (request_irq(i, &probe_intr, SA_INTERRUPT, "NCR-probe", NULL) == 0))
+               if ((mask & possible) && (request_irq(i, &probe_intr, IRQF_DISABLED, "NCR-probe", NULL) == 0))
                        trying_irqs |= mask;
 
        timeout = jiffies + (250 * HZ / 1000);
@@ -1147,7 +1147,6 @@ static void NCR5380_main(void *p)
  *     NCR5380_intr    -       generic NCR5380 irq handler
  *     @irq: interrupt number
  *     @dev_id: device info
- *     @regs: registers (unused)
  *
  *     Handle interrupts, reestablishing I_T_L or I_T_L_Q nexuses
  *      from the disconnected queue, and restarting NCR5380_main() 
@@ -1156,7 +1155,7 @@ static void NCR5380_main(void *p)
  *     Locks: takes the needed instance locks
  */
 
-static irqreturn_t NCR5380_intr(int irq, void *dev_id, struct pt_regs *regs
+static irqreturn_t NCR5380_intr(int irq, void *dev_id) 
 {
        NCR5380_local_declare();
        struct Scsi_Host *instance = (struct Scsi_Host *)dev_id;
@@ -2377,7 +2376,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
  * 3..length+1  arguments
  *
  * Start the extended message buffer with the EXTENDED_MESSAGE
- * byte, since scsi_print_msg() wants the whole thing.  
+ * byte, since spi_print_msg() wants the whole thing.  
  */
                                        extended_msg[0] = EXTENDED_MESSAGE;
                                        /* Accept first byte by clearing ACK */
@@ -2424,7 +2423,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
                                default:
                                        if (!tmp) {
                                                printk("scsi%d: rejecting message ", instance->host_no);
-                                               scsi_print_msg(extended_msg);
+                                               spi_print_msg(extended_msg);
                                                printk("\n");
                                        } else if (tmp != EXTENDED_MESSAGE)
                                                scmd_printk(KERN_INFO, cmd,
@@ -2560,7 +2559,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) {
 
        if (!(msg[0] & 0x80)) {
                printk(KERN_ERR "scsi%d : expecting IDENTIFY message, got ", instance->host_no);
-               scsi_print_msg(msg);
+               spi_print_msg(msg);
                abort = 1;
        } else {
                /* Accept message by clearing ACK */