m68k/scsi: a3000 - Do not use legacy Scsi_Host.base
[safe/jmp/linux-2.6] / drivers / scsi / dtc.c
index 310d2f4..c2677ba 100644 (file)
 #include <asm/system.h>
 #include <linux/module.h>
 #include <linux/signal.h>
-#include <linux/sched.h>
 #include <linux/blkdev.h>
 #include <linux/delay.h>
 #include <linux/stat.h>
 #include <linux/string.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
-#include <asm/io.h>
+#include <linux/io.h>
 #include "scsi.h"
 #include <scsi/scsi_host.h>
 #include "dtc.h"
@@ -138,46 +137,44 @@ static struct override {
 #ifdef OVERRIDE
 [] __initdata = OVERRIDE;
 #else
-[4] __initdata = { {
-0, IRQ_AUTO}, {
-0, IRQ_AUTO}, {
-0, IRQ_AUTO}, {
-0, IRQ_AUTO}};
+[4] __initdata = {
+       { 0, IRQ_AUTO }, { 0, IRQ_AUTO }, { 0, IRQ_AUTO }, { 0, IRQ_AUTO }
+};
 #endif
 
-#define NO_OVERRIDES (sizeof(overrides) / sizeof(struct override))
+#define NO_OVERRIDES ARRAY_SIZE(overrides)
 
 static struct base {
        unsigned long address;
        int noauto;
-} bases[] __initdata = { 
-       { 0xcc000, 0 }, 
-       { 0xc8000, 0 }, 
-       { 0xdc000, 0 }, 
+} bases[] __initdata = {
+       { 0xcc000, 0 },
+       { 0xc8000, 0 },
+       { 0xdc000, 0 },
        { 0xd8000, 0 }
 };
 
-#define NO_BASES (sizeof (bases) / sizeof (struct base))
+#define NO_BASES ARRAY_SIZE(bases)
 
 static const struct signature {
        const char *string;
        int offset;
-} signatures[] = { 
+} signatures[] = {
        {"DATA TECHNOLOGY CORPORATION BIOS", 0x25},
 };
 
-#define NO_SIGNATURES (sizeof (signatures) /  sizeof (struct signature))
+#define NO_SIGNATURES ARRAY_SIZE(signatures)
 
 #ifndef MODULE
 /*
  * Function : dtc_setup(char *str, int *ints)
  *
  * Purpose : LILO command line initialization of the overrides array,
- * 
+ *
  * Inputs : str - unused, ints - array of integer parameters with ints[0]
  *     equal to the number of ints.
  *
-*/
+ */
 
 static void __init dtc_setup(char *str, int *ints)
 {
@@ -234,7 +231,7 @@ static int __init dtc_detect(struct scsi_host_template * tpnt)
                } else
                        for (; !addr && (current_base < NO_BASES); ++current_base) {
 #if (DTCDEBUG & DTCDEBUG_INIT)
-                               printk("scsi-dtc : probing address %08x\n", bases[current_base].address);
+                               printk(KERN_DEBUG "scsi-dtc : probing address %08x\n", bases[current_base].address);
 #endif
                                if (bases[current_base].noauto)
                                        continue;
@@ -245,7 +242,7 @@ static int __init dtc_detect(struct scsi_host_template * tpnt)
                                        if (check_signature(base + signatures[sig].offset, signatures[sig].string, strlen(signatures[sig].string))) {
                                                addr = bases[current_base].address;
 #if (DTCDEBUG & DTCDEBUG_INIT)
-                                               printk("scsi-dtc : detected board.\n");
+                                               printk(KERN_DEBUG "scsi-dtc : detected board.\n");
 #endif
                                                goto found;
                                        }
@@ -254,7 +251,7 @@ static int __init dtc_detect(struct scsi_host_template * tpnt)
                        }
 
 #if defined(DTCDEBUG) && (DTCDEBUG & DTCDEBUG_INIT)
-               printk("scsi-dtc : base = %08x\n", addr);
+               printk(KERN_DEBUG "scsi-dtc : base = %08x\n", addr);
 #endif
 
                if (!addr)
@@ -280,7 +277,8 @@ found:
                /* With interrupts enabled, it will sometimes hang when doing heavy
                 * reads. So better not enable them until I finger it out. */
                if (instance->irq != SCSI_IRQ_NONE)
-                       if (request_irq(instance->irq, dtc_intr, SA_INTERRUPT, "dtc", instance)) {
+                       if (request_irq(instance->irq, dtc_intr, IRQF_DISABLED,
+                                       "dtc", instance)) {
                                printk(KERN_ERR "scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq);
                                instance->irq = SCSI_IRQ_NONE;
                        }
@@ -462,7 +460,7 @@ static int dtc_release(struct Scsi_Host *shost)
        NCR5380_local_declare();
        NCR5380_setup(shost);
        if (shost->irq)
-               free_irq(shost->irq, NULL);
+               free_irq(shost->irq, shost);
        NCR5380_exit(shost);
        if (shost->io_port && shost->n_io_port)
                release_region(shost->io_port, shost->n_io_port);