Revert to Fedora kernel-2.6.17-1.2187_FC5 patched with vs2.0.2.1; there are too many...
[linux-2.6.git] / drivers / scsi / esp.c
index 5237cad..87a8c3d 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/init.h>
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
+#include <linux/module.h>
 
 #include "esp.h"
 
 #include <asm/oplib.h>
 #include <asm/io.h>
 #include <asm/irq.h>
-
 #ifndef __sparc_v9__
 #include <asm/machines.h>
 #include <asm/idprom.h>
 #endif
 
-#include <linux/module.h>
+#include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_device.h>
+#include <scsi/scsi_eh.h>
+#include <scsi/scsi_host.h>
+#include <scsi/scsi_tcq.h>
+
+#define DRV_VERSION "1.101"
 
 #define DEBUG_ESP
 /* #define DEBUG_ESP_HME */
@@ -180,7 +187,7 @@ enum {
 
 /* The master ring of all esp hosts we are managing in this driver. */
 static struct esp *espchain;
-static spinlock_t espchain_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(espchain_lock);
 static int esps_running = 0;
 
 /* Forward declarations. */
@@ -1140,7 +1147,7 @@ static int __init esp_detect(struct scsi_host_template *tpnt)
        static struct sbus_dev esp_dev;
        int esps_in_use = 0;
 
-       espchain = 0;
+       espchain = NULL;
 
        if (sun4_esp_physaddr) {
                memset (&esp_dev, 0, sizeof(esp_dev));
@@ -2061,14 +2068,12 @@ static int esp_reset(struct scsi_cmnd *SCptr)
 {
        struct esp *esp = (struct esp *) SCptr->device->host->hostdata;
 
+       spin_lock_irq(esp->ehost->host_lock);
        (void) esp_do_resetbus(esp);
-
        spin_unlock_irq(esp->ehost->host_lock);
 
        wait_event(esp->reset_queue, (esp->resetting_bus == 0));
 
-       spin_lock_irq(esp->ehost->host_lock);
-
        return SUCCESS;
 }
 
@@ -2506,7 +2511,7 @@ static inline void esp_reconnect(struct esp *esp, struct scsi_cmnd *sp)
                ESPLOG(("esp%d: Weird, being reselected but disconnected "
                        "command queue is empty.\n", esp->esp_id));
        esp->snip = 0;
-       esp->current_SC = 0;
+       esp->current_SC = NULL;
        sp->SCp.phase = not_issued;
        append_SC(&esp->issue_SC, sp);
 }
@@ -4141,7 +4146,7 @@ static int esp_work_bus(struct esp *esp)
 }
 
 static espfunc_t isvc_vector[] = {
-       0,
+       NULL,
        esp_do_phase_determine,
        esp_do_resetbus,
        esp_finish_reset,
@@ -4393,5 +4398,8 @@ static struct scsi_host_template driver_template = {
 
 #include "scsi_module.c"
 
+MODULE_DESCRIPTION("EnhancedScsiProcessor Sun SCSI driver");
+MODULE_AUTHOR("David S. Miller (davem@redhat.com)");
 MODULE_LICENSE("GPL");
+MODULE_VERSION(DRV_VERSION);