Merge master.kernel.org:/home/rmk/linux-2.6-mmc
[powerpc.git] / drivers / scsi / in2000.c
index e1fe6f1..34daa3e 100644 (file)
@@ -343,7 +343,7 @@ static int in2000_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
        instance = cmd->device->host;
        hostdata = (struct IN2000_hostdata *) instance->hostdata;
 
-       DB(DB_QUEUE_COMMAND, printk("Q-%d-%02x-%ld(", cmd->device->id, cmd->cmnd[0], cmd->pid))
+       DB(DB_QUEUE_COMMAND, scmd_printk(KERN_DEBUG, cmd, "Q-%02x-%ld(", cmd->cmnd[0], cmd->pid))
 
 /* Set up a few fields in the Scsi_Cmnd structure for our own use:
  *  - host_scribble is the pointer to the next cmd in the input queue
@@ -1644,14 +1644,16 @@ static int in2000_bus_reset(Scsi_Cmnd * cmd)
        struct Scsi_Host *instance;
        struct IN2000_hostdata *hostdata;
        int x;
+       unsigned long flags;
 
        instance = cmd->device->host;
        hostdata = (struct IN2000_hostdata *) instance->hostdata;
 
        printk(KERN_WARNING "scsi%d: Reset. ", instance->host_no);
 
-       /* do scsi-reset here */
+       spin_lock_irqsave(instance->host_lock, flags);
 
+       /* do scsi-reset here */
        reset_hardware(instance, RESET_CARD_AND_BUS);
        for (x = 0; x < 8; x++) {
                hostdata->busy[x] = 0;
@@ -1668,10 +1670,12 @@ static int in2000_bus_reset(Scsi_Cmnd * cmd)
        hostdata->outgoing_len = 0;
 
        cmd->result = DID_RESET << 16;
+
+       spin_unlock_irqrestore(instance->host_lock, flags);
        return SUCCESS;
 }
 
-static int in2000_abort(Scsi_Cmnd * cmd)
+static int __in2000_abort(Scsi_Cmnd * cmd)
 {
        struct Scsi_Host *instance;
        struct IN2000_hostdata *hostdata;
@@ -1792,6 +1796,16 @@ static int in2000_abort(Scsi_Cmnd * cmd)
        return SUCCESS;
 }
 
+static int in2000_abort(Scsi_Cmnd * cmd)
+{
+       int rc;
+
+       spin_lock_irq(cmd->device->host->host_lock);
+       rc = __in2000_abort(cmd);
+       spin_unlock_irq(cmd->device->host->host_lock);
+
+       return rc;
+}
 
 
 #define MAX_IN2000_HOSTS 3
@@ -1885,7 +1899,7 @@ static int int_tab[] in2000__INITDATA = {
 };
 
 
-static int __init in2000_detect(Scsi_Host_Template * tpnt)
+static int __init in2000_detect(struct scsi_host_template * tpnt)
 {
        struct Scsi_Host *instance;
        struct IN2000_hostdata *hostdata;
@@ -2291,7 +2305,7 @@ static int in2000_proc_info(struct Scsi_Host *instance, char *buf, char **start,
 MODULE_LICENSE("GPL");
 
 
-static Scsi_Host_Template driver_template = {
+static struct scsi_host_template driver_template = {
        .proc_name                      = "in2000",
        .proc_info                      = in2000_proc_info,
        .name                           = "Always IN2000",