--- c/drivers/scsi/gdth.c	2004-04-04 15:35:08.000000000 +0200
+++ a/drivers/scsi/gdth.c	2004-05-17 12:53:27.000000000 +0200
@@ -353,21 +353,13 @@
 #ifdef GDTH_RTC
 #include <linux/mc146818rtc.h>
 #endif
-#if LINUX_VERSION_CODE >= 0x020100
 #include <linux/reboot.h>
-#else
-#include <linux/bios32.h>
-#endif
 
 #include <asm/dma.h>
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
-#if LINUX_VERSION_CODE >= 0x020322
 #include <linux/spinlock.h>
-#elif LINUX_VERSION_CODE >= 0x02015F
-#include <asm/spinlock.h>
-#endif
 
 #include <linux/blkdev.h>
 
@@ -435,15 +427,8 @@ static int gdth_ioctl(struct inode *inod
                       unsigned int cmd, unsigned long arg);
 #endif
 
-#if LINUX_VERSION_CODE >= 0x010300
 static void gdth_flush(int hanum);
-#if LINUX_VERSION_CODE >= 0x020100
 static int gdth_halt(struct notifier_block *nb, ulong event, void *buf);
-#else
-static int halt_called = FALSE;
-void gdth_halt(void);
-#endif
-#endif
 
 #ifdef DEBUG_GDTH
 static unchar   DebugState = DEBUG_GDTH;
@@ -542,64 +527,6 @@ static struct timer_list gdth_timer;
 
 #define BUS_L2P(a,b)    ((b)>(a)->virt_bus ? (b-1):(b))
 
-#if LINUX_VERSION_CODE < 0x010300
-static void *gdth_mmap(ulong paddr, ulong size) 
-{
-    if (paddr >= high_memory)
-        return NULL; 
-    else
-        return (void *)paddr;
-}
-static void gdth_munmap(void *addr) 
-{
-}
-inline ulong32 virt_to_phys(volatile void *addr)
-{
-    return (ulong32)addr;
-}
-inline void *phys_to_virt(ulong32 addr)
-{
-    return (void *)addr;
-}
-#define virt_to_bus             virt_to_phys
-#define bus_to_virt             phys_to_virt
-#define gdth_readb(addr)        (*(volatile unchar *)(addr))
-#define gdth_readw(addr)        (*(volatile ushort *)(addr))
-#define gdth_readl(addr)        (*(volatile ulong32 *)(addr))
-#define gdth_writeb(b,addr)     (*(volatile unchar *)(addr) = (b))
-#define gdth_writew(b,addr)     (*(volatile ushort *)(addr) = (b))
-#define gdth_writel(b,addr)     (*(volatile ulong32 *)(addr) = (b))
-#define memset_io(a,b,c)        memset((void *)(a),(b),(c))
-#define memcpy_fromio(a,b,c)    memcpy((a),(void *)(b),(c))
-#define memcpy_toio(a,b,c)      memcpy((void *)(a),(b),(c))
-
-#define PCI_SLOT(devfn)         ((devfn >> 3) & 0x1f)
-
-#elif LINUX_VERSION_CODE < 0x020100
-static int remapped = FALSE;
-static void *gdth_mmap(ulong paddr, ulong size) 
-{
-    if ( paddr >= high_memory) {
-        remapped = TRUE;
-        return vremap(paddr, size);
-    } else {
-        return (void *)paddr; 
-    }
-}
-static void gdth_munmap(void *addr) 
-{
-    if (remapped)
-        vfree(addr);
-    remapped = FALSE;
-}
-#define gdth_readb(addr)        readb((ulong)(addr))
-#define gdth_readw(addr)        readw((ulong)(addr))
-#define gdth_readl(addr)        (ulong32)readl((ulong)(addr))
-#define gdth_writeb(b,addr)     writeb((b),(ulong)(addr))
-#define gdth_writew(b,addr)     writew((b),(ulong)(addr))
-#define gdth_writel(b,addr)     writel((ulong32)(b),(ulong)(addr))
-
-#else
 static void *gdth_mmap(ulong paddr, ulong size) 
 { 
     return ioremap(paddr, size); 
@@ -614,7 +541,6 @@ static void gdth_munmap(void *addr) 
 #define gdth_writeb(b,addr)     writeb((b),(ulong)(addr))
 #define gdth_writew(b,addr)     writew((b),(ulong)(addr))
 #define gdth_writel(b,addr)     writel((ulong32)(b),(ulong)(addr))
-#endif
 
 
 static unchar   gdth_drq_tab[4] = {5,6,7,7};            /* DRQ table */
@@ -659,47 +585,24 @@ static unchar gdth_direction_tab[0x100] 
 };
 
 /* __initfunc, __initdata macros */
-#if LINUX_VERSION_CODE >= 0x020322
-#define GDTH_INITFUNC(type, func)       type __init func 
 #include <linux/init.h>
-#elif LINUX_VERSION_CODE >= 0x020126
-#define GDTH_INITFUNC(type, func)       __initfunc(type func)
-#include <linux/init.h>
-#else
-#define GDTH_INITFUNC(type, func)       type func
-#define __initdata
-#define __init
-#endif
 
-#if LINUX_VERSION_CODE >= 0x020503
 #define GDTH_INIT_LOCK_HA(ha)           spin_lock_init(&(ha)->smp_lock)
 #define GDTH_LOCK_HA(ha,flags)          spin_lock_irqsave(&(ha)->smp_lock,flags)
 #define GDTH_UNLOCK_HA(ha,flags)        spin_unlock_irqrestore(&(ha)->smp_lock,flags)
 
+#if LINUX_VERSION_CODE >= 0x020503
 #define GDTH_LOCK_SCSI_DONE(dev, flags) spin_lock_irqsave(dev->host_lock,flags)
 #define GDTH_UNLOCK_SCSI_DONE(dev, flags) spin_unlock_irqrestore(dev->host_lock,flags)
 #define GDTH_LOCK_SCSI_DOCMD(dev)       spin_lock_irq(dev->host_lock)
 #define GDTH_UNLOCK_SCSI_DOCMD(dev)     spin_unlock_irq(dev->host_lock)
 
-#elif LINUX_VERSION_CODE >= 0x02015F
-#define GDTH_INIT_LOCK_HA(ha)           spin_lock_init(&(ha)->smp_lock)
-#define GDTH_LOCK_HA(ha,flags)          spin_lock_irqsave(&(ha)->smp_lock,flags)
-#define GDTH_UNLOCK_HA(ha,flags)        spin_unlock_irqrestore(&(ha)->smp_lock,flags)
-
+#else
 #define GDTH_LOCK_SCSI_DONE(flags)      spin_lock_irqsave(&io_request_lock,flags)
 #define GDTH_UNLOCK_SCSI_DONE(flags)    spin_unlock_irqrestore(&io_request_lock,flags)
 #define GDTH_LOCK_SCSI_DOCMD()          spin_lock_irq(&io_request_lock)
 #define GDTH_UNLOCK_SCSI_DOCMD()        spin_unlock_irq(&io_request_lock)
 
-#else
-#define GDTH_INIT_LOCK_HA(ha)           do {} while (0)
-#define GDTH_LOCK_HA(ha,flags)          do {save_flags(flags); cli();} while (0)
-#define GDTH_UNLOCK_HA(ha,flags)        do {restore_flags(flags);} while (0)
-
-#define GDTH_LOCK_SCSI_DONE(flags)      do {} while (0)
-#define GDTH_UNLOCK_SCSI_DONE(flags)    do {} while (0)
-#define GDTH_LOCK_SCSI_DOCMD()          do {} while (0)
-#define GDTH_UNLOCK_SCSI_DOCMD()        do {} while (0)
 #endif
 
 /* LILO and modprobe/insmod parameters */
@@ -731,8 +634,6 @@ static int shared_access = 1;
 /* enable support for EISA and ISA controllers */
 static int probe_eisa_isa = 0;
 
-#ifdef MODULE
-#if LINUX_VERSION_CODE >= 0x02011A
 /* parameters for modprobe/insmod */
 MODULE_PARM(irq, "i");
 MODULE_PARM(disable, "i");
@@ -746,11 +647,7 @@ MODULE_PARM(virt_ctr, "i");
 MODULE_PARM(shared_access, "i");
 MODULE_PARM(probe_eisa_isa, "i");
 MODULE_AUTHOR("Achim Leubner");
-#endif
-#if LINUX_VERSION_CODE >= 0x02040B
 MODULE_LICENSE("GPL");
-#endif
-#endif
 
 #ifdef GDTH_IOCTL_CHRDEV
 /* ioctl interface */
@@ -762,24 +659,14 @@ static struct file_operations gdth_fops 
 #endif
 
 /* /proc support */
-#if LINUX_VERSION_CODE >= 0x010300
 #include <linux/stat.h> 
-#if LINUX_VERSION_CODE < 0x020322
-struct proc_dir_entry proc_scsi_gdth = {
-    PROC_SCSI_GDTH, 4, "gdth",
-    S_IFDIR | S_IRUGO | S_IXUGO, 2
-};
-#endif
 #include "gdth_proc.h"
 #include "gdth_proc.c"
-#endif
 
-#if LINUX_VERSION_CODE >= 0x020100
 /* notifier block to get a notify on system shutdown/halt/reboot */
 static struct notifier_block gdth_notifier = {
     gdth_halt, NULL, 0
 };
-#endif
 
 
 static void gdth_delay(int milliseconds)
@@ -787,13 +674,7 @@ static void gdth_delay(int milliseconds)
     if (milliseconds == 0) {
         udelay(1);
     } else {
-#if LINUX_VERSION_CODE >= 0x020168
         mdelay(milliseconds);
-#else
-        int i;
-        for (i = 0; i < milliseconds; ++i) 
-            udelay(1000);
-#endif
     }
 }
 
@@ -818,7 +699,7 @@ static void gdth_eval_mapping(ulong32 si
 
 /* controller search and initialization functions */
 
-GDTH_INITFUNC(static int, gdth_search_eisa(ushort eisa_adr))
+static int __init gdth_search_eisa(ushort eisa_adr)
 {
     ulong32 id;
     
@@ -836,7 +717,7 @@ GDTH_INITFUNC(static int, gdth_search_ei
 }
 
 
-GDTH_INITFUNC(static int, gdth_search_isa(ulong32 bios_adr))
+static int __init gdth_search_isa(ulong32 bios_adr)
 {
     void *addr;
     ulong32 id;
@@ -852,7 +733,7 @@ GDTH_INITFUNC(static int, gdth_search_is
 }
 
 
-GDTH_INITFUNC(static int, gdth_search_pci(gdth_pci_str *pcistr))
+static int __init gdth_search_pci(gdth_pci_str *pcistr)
 {
     ushort device, cnt;
     
@@ -873,7 +754,6 @@ GDTH_INITFUNC(static int, gdth_search_pc
     return cnt;
 }
 
-#if LINUX_VERSION_CODE >= 0x20363
 /* Vortex only makes RAID controllers.
  * We do not really want to specify all 550 ids here, so wildcard match.
  */
@@ -884,23 +764,16 @@ static struct pci_device_id gdthtable[] 
     {0}
 };
 MODULE_DEVICE_TABLE(pci,gdthtable);
-#endif
 
-GDTH_INITFUNC(static void, gdth_search_dev(gdth_pci_str *pcistr, ushort *cnt,
-                                           ushort vendor, ushort device))
+static void __init gdth_search_dev(gdth_pci_str *pcistr, ushort *cnt,
+                                           ushort vendor, ushort device)
 {
     ulong base0, base1, base2;
-#if LINUX_VERSION_CODE >= 0x2015C
     struct pci_dev *pdev;
-#else
-    int error;
-    ushort idx;
-#endif
     
     TRACE(("gdth_search_dev() cnt %d vendor %x device %x\n",
           *cnt, vendor, device));
 
-#if LINUX_VERSION_CODE >= 0x20363
     pdev = NULL;
     while ((pdev = pci_find_device(vendor, device, pdev)) 
            != NULL) {
@@ -938,112 +811,10 @@ GDTH_INITFUNC(static void, gdth_search_d
                 pcistr[*cnt].irq, pcistr[*cnt].dpmem));
         (*cnt)++;
     }       
-#elif LINUX_VERSION_CODE >= 0x2015C
-    pdev = NULL;
-    while ((pdev = pci_find_device(vendor, device, pdev)) 
-           != NULL) {
-        if (*cnt >= MAXHA)
-            return;
-        /* GDT PCI controller found, resources are already in pdev */
-        pcistr[*cnt].pdev = pdev;
-        pcistr[*cnt].vendor_id = vendor;
-        pcistr[*cnt].device_id = device;
-        pcistr[*cnt].bus = pdev->bus->number;
-        pcistr[*cnt].device_fn = pdev->devfn;
-        pcibios_read_config_word(pcistr[*cnt].bus, pcistr[*cnt].device_fn,
-                                 PCI_SUBSYSTEM_ID, &pcistr[*cnt].subdevice_id);
-        pcistr[*cnt].irq = pdev->irq;
-        base0 = pdev->base_address[0];
-        base1 = pdev->base_address[1];
-        base2 = pdev->base_address[2];
-        if (device <= PCI_DEVICE_ID_VORTEX_GDT6000B ||   /* GDT6000/B */
-            device >= PCI_DEVICE_ID_VORTEX_GDT6x17RP) {  /* MPR */
-            if ((base0 & PCI_BASE_ADDRESS_SPACE) != 
-                PCI_BASE_ADDRESS_SPACE_MEMORY)
-                continue;
-            pcistr[*cnt].dpmem = base0 & PCI_BASE_ADDRESS_MEM_MASK;
-        } else {                                  /* GDT6110, GDT6120, .. */
-            if ((base0 & PCI_BASE_ADDRESS_SPACE) !=
-                PCI_BASE_ADDRESS_SPACE_MEMORY ||
-                (base2 & PCI_BASE_ADDRESS_SPACE) !=
-                PCI_BASE_ADDRESS_SPACE_MEMORY ||
-                (base1 & PCI_BASE_ADDRESS_SPACE) !=
-                PCI_BASE_ADDRESS_SPACE_IO)
-                continue;
-            pcistr[*cnt].dpmem = base2 & PCI_BASE_ADDRESS_MEM_MASK;
-            pcistr[*cnt].io_mm = base0 & PCI_BASE_ADDRESS_MEM_MASK;
-            pcistr[*cnt].io    = base1 & PCI_BASE_ADDRESS_IO_MASK;
-        }
-        TRACE2(("Controller found at %d/%d, irq %d, dpmem 0x%lx\n",
-                pcistr[*cnt].bus, PCI_SLOT(pcistr[*cnt].device_fn), 
-                pcistr[*cnt].irq, pcistr[*cnt].dpmem));
-        (*cnt)++;
-    }       
-#else   
-    idx = 0;
-    while (!pcibios_find_device(vendor, device, idx++,
-                                &pcistr[*cnt].bus,&pcistr[*cnt].device_fn)) {
-        if (*cnt >= MAXHA)
-            return;
-        /* GDT PCI ctr. found, now read resources from config space */
-#if LINUX_VERSION_CODE >= 0x010300
-#define GDTH_BASEP      (int *)
-#else
-#define GDTH_BASEP
-#endif
-        if ((error = pcibios_read_config_dword(pcistr[*cnt].bus,
-                                               pcistr[*cnt].device_fn,
-                                               PCI_BASE_ADDRESS_0,
-                                               GDTH_BASEP&base0)) ||
-            (error = pcibios_read_config_dword(pcistr[*cnt].bus,
-                                               pcistr[*cnt].device_fn,
-                                               PCI_BASE_ADDRESS_1,
-                                               GDTH_BASEP&base1)) ||
-            (error = pcibios_read_config_dword(pcistr[*cnt].bus,
-                                               pcistr[*cnt].device_fn,
-                                               PCI_BASE_ADDRESS_2,
-                                               GDTH_BASEP&base2)) ||
-            (error = pcibios_read_config_word(pcistr[*cnt].bus,
-                                              pcistr[*cnt].device_fn,
-                                              PCI_SUBSYSTEM_ID,
-                                              &pcistr[*cnt].subdevice_id)) ||
-            (error = pcibios_read_config_byte(pcistr[*cnt].bus,
-                                              pcistr[*cnt].device_fn,
-                                              PCI_INTERRUPT_LINE,
-                                              &pcistr[*cnt].irq))) {
-            printk("GDT-PCI: error %d reading configuration space", error);
-            continue;
-        }
-        pcistr[*cnt].vendor_id = vendor;
-        pcistr[*cnt].device_id = device;
-        if (device <= PCI_DEVICE_ID_VORTEX_GDT6000B ||   /* GDT6000/B */
-            device >= PCI_DEVICE_ID_VORTEX_GDT6x17RP) {  /* MPR */
-            if ((base0 & PCI_BASE_ADDRESS_SPACE) !=
-                PCI_BASE_ADDRESS_SPACE_MEMORY)
-                continue;
-            pcistr[*cnt].dpmem = base0 & PCI_BASE_ADDRESS_MEM_MASK;
-        } else {                                    /* GDT6110, GDT6120, .. */
-            if ((base0 & PCI_BASE_ADDRESS_SPACE) !=
-                PCI_BASE_ADDRESS_SPACE_MEMORY ||
-                (base2 & PCI_BASE_ADDRESS_SPACE) !=
-                PCI_BASE_ADDRESS_SPACE_MEMORY ||
-                (base1 & PCI_BASE_ADDRESS_SPACE) !=
-                PCI_BASE_ADDRESS_SPACE_IO)
-                continue;
-            pcistr[*cnt].dpmem = base2 & PCI_BASE_ADDRESS_MEM_MASK;
-            pcistr[*cnt].io_mm = base0 & PCI_BASE_ADDRESS_MEM_MASK;
-            pcistr[*cnt].io    = base1 & PCI_BASE_ADDRESS_IO_MASK;
-        }
-        TRACE2(("Controller found at %d/%d, irq %d, dpmem 0x%lx\n",
-                pcistr[*cnt].bus, PCI_SLOT(pcistr[*cnt].device_fn), 
-                pcistr[*cnt].irq, pcistr[*cnt].dpmem));
-        (*cnt)++;
-    }
-#endif
 }   
 
 
-GDTH_INITFUNC(static void, gdth_sort_pci(gdth_pci_str *pcistr, int cnt))
+static void __init gdth_sort_pci(gdth_pci_str *pcistr, int cnt)
 {    
     gdth_pci_str temp;
     int i, changed;
@@ -1081,7 +852,7 @@ GDTH_INITFUNC(static void, gdth_sort_pci
 }
 
 
-GDTH_INITFUNC(static int, gdth_init_eisa(ushort eisa_adr,gdth_ha_str *ha))
+static int __init gdth_init_eisa(ushort eisa_adr,gdth_ha_str *ha)
 {
     ulong32 retries,id;
     unchar prot_ver,eisacf,i,irq_found;
@@ -1172,7 +943,7 @@ GDTH_INITFUNC(static int, gdth_init_eisa
 }
 
        
-GDTH_INITFUNC(static int, gdth_init_isa(ulong32 bios_adr,gdth_ha_str *ha))
+static int __init gdth_init_isa(ulong32 bios_adr,gdth_ha_str *ha)
 {
     register gdt2_dpram_str *dp2_ptr;
     int i;
@@ -1270,7 +1041,7 @@ GDTH_INITFUNC(static int, gdth_init_isa(
 }
 
 
-GDTH_INITFUNC(static int, gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha))
+static int __init gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha)
 {
     register gdt6_dpram_str *dp6_ptr;
     register gdt6c_dpram_str *dp6c_ptr;
@@ -1279,9 +1050,6 @@ GDTH_INITFUNC(static int, gdth_init_pci(
     unchar prot_ver;
     ushort command;
     int i, found = FALSE;
-#if LINUX_VERSION_CODE < 0x2015C
-    int rom_addr;
-#endif
 
     TRACE(("gdth_init_pci()\n"));
 
@@ -1293,9 +1061,7 @@ GDTH_INITFUNC(static int, gdth_init_pci(
     ha->stype = (ulong32)pcistr->device_id;
     ha->subdevice_id = pcistr->subdevice_id;
     ha->irq = pcistr->irq;
-#if LINUX_VERSION_CODE >= 0x20400
     ha->pdev = pcistr->pdev;
-#endif
     
     if (ha->stype <= PCI_DEVICE_ID_VORTEX_GDT6000B) {  /* GDT6000/B */
         TRACE2(("init_pci() dpmem %lx irq %d\n",pcistr->dpmem,ha->irq));
@@ -1323,13 +1089,8 @@ GDTH_INITFUNC(static int, gdth_init_pci(
                     continue;
                 }
                 gdth_munmap(ha->brd);
-#if LINUX_VERSION_CODE >= 0x2015C
                 pci_write_config_dword(pcistr->pdev, 
                                        PCI_BASE_ADDRESS_0, i);
-#else
-                pcibios_write_config_dword(pcistr->bus, pcistr->device_fn,
-                                           PCI_BASE_ADDRESS_0, i);
-#endif
                 ha->brd = gdth_mmap(i, sizeof(gdt6_dpram_str)); 
                 if (ha->brd == NULL) {
                     printk("GDT-PCI: Initialization error (DPMEM remap error)\n");
@@ -1436,13 +1197,8 @@ GDTH_INITFUNC(static int, gdth_init_pci(
                     continue;
                 }
                 gdth_munmap(ha->brd);
-#if LINUX_VERSION_CODE >= 0x2015C
                 pci_write_config_dword(pcistr->pdev, 
                                        PCI_BASE_ADDRESS_2, i);
-#else
-                pcibios_write_config_dword(pcistr->bus, pcistr->device_fn,
-                                           PCI_BASE_ADDRESS_2, i);
-#endif
                 ha->brd = gdth_mmap(i, sizeof(gdt6c_dpram_str)); 
                 if (ha->brd == NULL) {
                     printk("GDT-PCI: Initialization error (DPMEM remap error)\n");
@@ -1532,7 +1288,6 @@ GDTH_INITFUNC(static int, gdth_init_pci(
         }
 
         /* manipulate config. space to enable DPMEM, start RP controller */
-#if LINUX_VERSION_CODE >= 0x20363
         pci_read_config_word(pcistr->pdev, PCI_COMMAND, &command);
         command |= 6;
         pci_write_config_word(pcistr->pdev, PCI_COMMAND, command);
@@ -1543,34 +1298,6 @@ GDTH_INITFUNC(static int, gdth_init_pci(
         gdth_delay(1);
         pci_write_config_dword(pcistr->pdev, PCI_ROM_ADDRESS,
                                pci_resource_start(pcistr->pdev, 8));
-#elif LINUX_VERSION_CODE >= 0x2015C
-        pci_read_config_word(pcistr->pdev, PCI_COMMAND, &command);
-        command |= 6;
-        pci_write_config_word(pcistr->pdev, PCI_COMMAND, command);
-        if (pcistr->pdev->rom_address == 1UL)
-            pcistr->pdev->rom_address = 0UL;
-        i = 0xFEFF0001UL;
-        pci_write_config_dword(pcistr->pdev, PCI_ROM_ADDRESS, i);
-        gdth_delay(1);
-        pci_write_config_dword(pcistr->pdev, PCI_ROM_ADDRESS,
-                               pcistr->pdev->rom_address);
-#else
-        pcibios_read_config_word(pcistr->bus, pcistr->device_fn,
-                                 PCI_COMMAND, &command);
-        command |= 6;
-        pcibios_write_config_word(pcistr->bus, pcistr->device_fn, 
-                                  PCI_COMMAND, command);
-        pcibios_read_config_dword(pcistr->bus, pcistr->device_fn,
-                                  PCI_ROM_ADDRESS, &rom_addr);
-        if (rom_addr == 1UL)
-            rom_addr = 0UL;
-        i = 0xFEFF0001UL;
-        pcibios_write_config_dword(pcistr->bus, pcistr->device_fn,
-                                   PCI_ROM_ADDRESS, i);
-        gdth_delay(1);
-        pcibios_write_config_dword(pcistr->bus, pcistr->device_fn,
-                                   PCI_ROM_ADDRESS, rom_addr);
-#endif
         
         /* Ensure that it is safe to access the non HW portions of DPMEM.
          * Aditional check needed for Xscale based RAID controllers */
@@ -1596,13 +1323,8 @@ GDTH_INITFUNC(static int, gdth_init_pci(
                     continue;
                 }
                 gdth_munmap(ha->brd);
-#if LINUX_VERSION_CODE >= 0x2015C
                 pci_write_config_dword(pcistr->pdev, 
                                        PCI_BASE_ADDRESS_0, i);
-#else
-                pcibios_write_config_dword(pcistr->bus, pcistr->device_fn,
-                                           PCI_BASE_ADDRESS_0, i);
-#endif
                 ha->brd = gdth_mmap(i, sizeof(gdt6m_dpram_str)); 
                 if (ha->brd == NULL) {
                     printk("GDT-PCI: Initialization error (DPMEM remap error)\n");
@@ -1681,7 +1403,7 @@ GDTH_INITFUNC(static int, gdth_init_pci(
 
 /* controller protocol functions */
 
-GDTH_INITFUNC(static void, gdth_enable_int(int hanum))
+static void __init gdth_enable_int(int hanum)
 {
     gdth_ha_str *ha;
     ulong flags;
@@ -2016,7 +1738,7 @@ static int gdth_internal_cmd(int hanum,u
 
 /* search for devices */
 
-GDTH_INITFUNC(static int, gdth_search_drives(int hanum))
+static int __init gdth_search_drives(int hanum)
 {
     register gdth_ha_str *ha;
     ushort cdev_cnt, i;
@@ -2405,7 +2127,6 @@ static void gdth_putq(int hanum,Scsi_Cmn
     b = virt_ctr ? NUMDATA(scp->host)->busnum : scp->channel;
     t = scp->target;
 #endif
-#if LINUX_VERSION_CODE >= 0x010300
     if (priority >= DEFAULT_PRI) {
         if ((b != ha->virt_bus && ha->raw[BUS_L2P(ha,b)].lock) ||
             (b == ha->virt_bus && t < MAX_HDRIVES && ha->hdr[t].lock)) {
@@ -2413,7 +2134,6 @@ static void gdth_putq(int hanum,Scsi_Cmn
             scp->SCp.buffers_residual = gdth_update_timeout(hanum, scp, 0);
         }
     }
-#endif
 
     if (ha->req_first==NULL) {
         ha->req_first = scp;                    /* queue was empty */
@@ -2493,11 +2213,8 @@ static void gdth_next(int hanum)
             firsttime = FALSE;
         }
 
-#if LINUX_VERSION_CODE >= 0x010300
-        if (nscp->done != gdth_scsi_done || nscp->cmnd[0] != 0xff) 
-#endif
-        {
-        if (nscp->SCp.phase == -1) {
+        if ((nscp->done != gdth_scsi_done || nscp->cmnd[0] != 0xff) &&
+			nscp->SCp.phase == -1) {
             nscp->SCp.phase = CACHESERVICE;           /* default: cache svc. */ 
             if (nscp->cmnd[0] == TEST_UNIT_READY) {
                 TRACE2(("TEST_UNIT_READY Bus %d Id %d LUN %d\n", 
@@ -2538,7 +2255,6 @@ static void gdth_next(int hanum)
                 nscp->SCp.sent_command = GDT_CLUST_INFO;
             }
         }
-        }
 
         if (nscp->SCp.sent_command != -1) {
             if ((nscp->SCp.phase & 0xff) == CACHESERVICE) {
@@ -2567,13 +2283,11 @@ static void gdth_next(int hanum)
             }
         } else
 
-#if LINUX_VERSION_CODE >= 0x010300
         if (nscp->done == gdth_scsi_done && nscp->cmnd[0] == 0xff) {
             if (!(cmd_index=gdth_special_cmd(hanum,nscp)))
                 this_cmd = FALSE;
             next_cmd = FALSE;
         } else
-#endif
         if (b != ha->virt_bus) {
             if (ha->raw[BUS_L2P(ha,b)].io_cnt[t] >= GDTH_MAX_RAW ||
                 !(cmd_index=gdth_fill_raw_cmd(hanum,nscp,BUS_L2P(ha,b)))) 
@@ -2757,7 +2471,6 @@ static void gdth_copy_internal_data(int 
 
     if (scp->use_sg) {
         sl = (struct scatterlist *)scp->request_buffer;
-#if LINUX_VERSION_CODE >= 0x020400
         sgcnt = pci_map_sg(ha->pdev,sl,scp->use_sg,PCI_DMA_FROMDEVICE);
         for (i=0,cpsum=0; i<sgcnt; ++i,++sl) {
             cpnow = (ushort)sg_dma_len(sl);
@@ -2774,22 +2487,6 @@ static void gdth_copy_internal_data(int 
         }
         pci_unmap_sg(ha->pdev,scp->request_buffer,
                      scp->use_sg,PCI_DMA_FROMDEVICE);
-#else
-        sgcnt = scp->use_sg;
-        for (i=0,cpsum=0; i<sgcnt; ++i,++sl) {
-            cpnow = (ushort)sl->length;
-            TRACE(("copy_internal() now %d sum %d count %d %d\n",
-                          cpnow,cpsum,cpcount,(ushort)scp->bufflen));
-            if (cpsum+cpnow > cpcount) 
-               cpnow = cpcount - cpsum;
-            cpsum += cpnow;
-            address = (char *)sl->address;
-            memcpy(address,buffer,cpnow);
-            if (cpsum == cpcount)
-                break;
-            buffer += cpnow;
-        }
-#endif
     } else {
         TRACE(("copy_internal() count %d\n",cpcount));
         memcpy((char*)scp->request_buffer,buffer,cpcount);
@@ -2962,7 +2659,6 @@ static int gdth_fill_cache_cmd(int hanum
             cmdp->u.cache.DestAddr= 0xffffffff;
             sl = (struct scatterlist *)scp->request_buffer;
             sgcnt = scp->use_sg;
-#if LINUX_VERSION_CODE >= 0x020400
             scp->SCp.Status = GDTH_MAP_SG;
             scp->SCp.Message = (read_write == 1 ? 
                 PCI_DMA_TODEVICE : PCI_DMA_FROMDEVICE);   
@@ -2971,12 +2667,6 @@ static int gdth_fill_cache_cmd(int hanum
                 cmdp->u.cache.sg_lst[i].sg_ptr = sg_dma_address(sl);
                 cmdp->u.cache.sg_lst[i].sg_len = sg_dma_len(sl);
             }
-#else
-            for (i=0; i<sgcnt; ++i,++sl) {
-                cmdp->u.cache.sg_lst[i].sg_ptr = virt_to_bus(sl->address);
-                cmdp->u.cache.sg_lst[i].sg_len = (ulong32)sl->length;
-            }
-#endif
             cmdp->u.cache.sg_canz = (ulong32)i;
 
 #ifdef GDTH_STATISTICS
@@ -2988,16 +2678,12 @@ static int gdth_fill_cache_cmd(int hanum
             if (i<GDTH_MAXSG)
                 cmdp->u.cache.sg_lst[i].sg_len = 0;
         } else {
-#if LINUX_VERSION_CODE >= 0x020400
             scp->SCp.Status = GDTH_MAP_SINGLE;
             scp->SCp.Message = (read_write == 1 ? 
                 PCI_DMA_TODEVICE : PCI_DMA_FROMDEVICE);   
             phys_addr = pci_map_single(ha->pdev,scp->request_buffer,
                                        scp->request_bufflen,scp->SCp.Message);
             scp->SCp.dma_handle = phys_addr;
-#else
-            phys_addr = virt_to_bus(scp->request_buffer);
-#endif
             if (ha->cache_feat & SCATTER_GATHER) {
                 cmdp->u.cache.DestAddr = 0xffffffff;
                 cmdp->u.cache.sg_canz = 1;
@@ -3084,13 +2770,9 @@ static int gdth_fill_raw_cmd(int hanum,S
         /* evaluate command size */
         ha->cmd_len = GDTOFFSOF(gdth_cmd_str,u.raw.sg_lst);
     } else {
-#if LINUX_VERSION_CODE >= 0x020400
         sense_paddr = pci_map_single(ha->pdev,scp->sense_buffer,
                                      16,PCI_DMA_FROMDEVICE);
         scp->SCp.buffer = (struct scatterlist *)sense_paddr;
-#else
-        sense_paddr = virt_to_bus(scp->sense_buffer);
-#endif
         cmdp->OpCode           = GDT_WRITE;             /* always */
         cmdp->BoardNode        = LOCALBOARD;
         cmdp->u.raw.reserved   = 0;
@@ -3113,7 +2795,6 @@ static int gdth_fill_raw_cmd(int hanum,S
             cmdp->u.raw.sdata  = 0xffffffff;
             sl = (struct scatterlist *)scp->request_buffer;
             sgcnt = scp->use_sg;
-#if LINUX_VERSION_CODE >= 0x020400
             scp->SCp.Status = GDTH_MAP_SG;
             scp->SCp.Message = PCI_DMA_BIDIRECTIONAL; 
             sgcnt = pci_map_sg(ha->pdev,sl,scp->use_sg,scp->SCp.Message);
@@ -3121,12 +2802,6 @@ static int gdth_fill_raw_cmd(int hanum,S
                 cmdp->u.raw.sg_lst[i].sg_ptr = sg_dma_address(sl);
                 cmdp->u.raw.sg_lst[i].sg_len = sg_dma_len(sl);
             }
-#else
-            for (i=0; i<sgcnt; ++i,++sl) {
-                cmdp->u.raw.sg_lst[i].sg_ptr = virt_to_bus(sl->address);
-                cmdp->u.raw.sg_lst[i].sg_len = (ulong32)sl->length;
-            }
-#endif
             cmdp->u.raw.sg_ranz = (ulong32)i;
 
 #ifdef GDTH_STATISTICS
@@ -3138,15 +2813,11 @@ static int gdth_fill_raw_cmd(int hanum,S
             if (i<GDTH_MAXSG)
                 cmdp->u.raw.sg_lst[i].sg_len = 0;
         } else {
-#if LINUX_VERSION_CODE >= 0x020400
             scp->SCp.Status = GDTH_MAP_SINGLE;
             scp->SCp.Message = PCI_DMA_BIDIRECTIONAL; 
             phys_addr = pci_map_single(ha->pdev,scp->request_buffer,
                                        scp->request_bufflen,scp->SCp.Message);
             scp->SCp.dma_handle = phys_addr;
-#else
-            phys_addr = virt_to_bus(scp->request_buffer);
-#endif
             if (ha->raw_feat & SCATTER_GATHER) {
                 cmdp->u.raw.sdata  = 0xffffffff;
                 cmdp->u.raw.sg_ranz= 1;
@@ -3666,7 +3337,6 @@ static int gdth_sync_event(int hanum,int
             /* retry */
             return 2;
         }
-#if LINUX_VERSION_CODE >= 0x020400
         if (scp->SCp.Status == GDTH_MAP_SG) 
             pci_unmap_sg(ha->pdev,scp->request_buffer,
                          scp->use_sg,scp->SCp.Message);
@@ -3676,7 +3346,6 @@ static int gdth_sync_event(int hanum,int
         if (scp->SCp.buffer) 
             pci_unmap_single(ha->pdev,(dma_addr_t)scp->SCp.buffer,
 						16,PCI_DMA_FROMDEVICE);
-#endif
         if (ha->status == S_OK) {
             scp->SCp.Status = S_OK;
             scp->SCp.Message = ha->info;
@@ -3754,10 +3423,7 @@ static int gdth_sync_event(int hanum,int
                     scp->sense_buffer[2] = NOT_READY;
                     scp->result = (DID_OK << 16) | (CHECK_CONDITION << 1);
                 }
-#if LINUX_VERSION_CODE >= 0x010300
-                if (scp->done != gdth_scsi_done)
-#endif  
-                {
+                if (scp->done != gdth_scsi_done) {
                     ha->dvr.size = sizeof(ha->dvr.eu.sync);
                     ha->dvr.eu.sync.ionode  = hanum;
                     ha->dvr.eu.sync.service = service;
@@ -4098,7 +3764,7 @@ void gdth_timeout(ulong data)
 }
 #endif
 
-GDTH_INITFUNC(void, internal_setup(char *str,int *ints))
+void __init internal_setup(char *str,int *ints)
 {
     int i, argc;
     char *cur_str, *argv;
@@ -4171,7 +3837,7 @@ GDTH_INITFUNC(void, internal_setup(char 
     }
 }
 
-GDTH_INITFUNC(int, option_setup(char *str))
+int __init option_setup(char *str)
 {
     int ints[MAXHA];
     char *cur = str;
@@ -4189,7 +3855,7 @@ GDTH_INITFUNC(int, option_setup(char *st
     return 1;
 }
 
-GDTH_INITFUNC(int, gdth_detect(Scsi_Host_Template *shtp))
+int __init gdth_detect(Scsi_Host_Template *shtp)
 {
     struct Scsi_Host *shp;
     gdth_ha_str *ha;
@@ -4252,11 +3918,7 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host
                 printk("Configuring GDT-ISA HA at BIOS 0x%05X IRQ %u DRQ %u\n",
                        isa_bios,ha->irq,ha->drq);
 
-#if LINUX_VERSION_CODE >= 0x010346 
                 if (request_irq(ha->irq,gdth_interrupt,SA_INTERRUPT,"gdth",ha))
-#else
-                if (request_irq(ha->irq,gdth_interrupt,SA_INTERRUPT,"gdth")) 
-#endif
                 {
                     printk("GDT-ISA: Unable to allocate IRQ\n");
                     scsi_unregister(shp);
@@ -4264,11 +3926,7 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host
                 }
                 if (request_dma(ha->drq,"gdth")) {
                     printk("GDT-ISA: Unable to allocate DMA channel\n");
-#if LINUX_VERSION_CODE >= 0x010346 
                     free_irq(ha->irq,ha);
-#else
-                    free_irq(ha->irq);
-#endif
                     scsi_unregister(shp);
                     continue;
                 }
@@ -4286,16 +3944,10 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host
 
                 ha->pccb = CMDDATA(shp);
                 ha->ccb_phys = 0L;
-#if LINUX_VERSION_CODE >= 0x020400
                 ha->pdev = NULL;
                 ha->pscratch = pci_alloc_consistent(ha->pdev, GDTH_SCRATCH, 
                                                     &scratch_dma_handle);
                 ha->scratch_phys = (ulong32)scratch_dma_handle;
-#else
-                ha->pscratch = scsi_init_malloc(GDTH_SCRATCH, GFP_ATOMIC | GFP_DMA);
-                if (ha->pscratch)
-                    ha->scratch_phys = virt_to_bus(ha->pscratch);
-#endif
                 ha->scratch_busy = FALSE;
                 ha->req_first = NULL;
                 ha->tid_cnt = MAX_HDRIVES;
@@ -4310,18 +3962,10 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host
                     --gdth_ctr_count;
                     --gdth_ctr_vcount;
                     if (ha->pscratch != NULL) {
-#if LINUX_VERSION_CODE >= 0x020400
                         pci_free_consistent(ha->pdev, GDTH_SCRATCH, 
                                             ha->pscratch, ha->scratch_phys);
-#else
-                        scsi_init_free((void *)ha->pscratch, GDTH_SCRATCH);
-#endif
                     }
-#if LINUX_VERSION_CODE >= 0x010346 
                     free_irq(ha->irq,ha);
-#else
-                    free_irq(ha->irq);
-#endif
                     scsi_unregister(shp);
                     continue;
                 }
@@ -4329,13 +3973,10 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host
                     hdr_channel = ha->bus_cnt;
                 ha->virt_bus = hdr_channel;
 
-#if LINUX_VERSION_CODE >= 0x020000
                 shp->max_id      = ha->tid_cnt;
                 shp->max_lun     = MAXLUN;
                 shp->max_channel = virt_ctr ? 0 : ha->bus_cnt;
-                if (virt_ctr)  
-#endif
-                {
+                if (virt_ctr) {
                     virt_ctr = 1;
                     /* register addit. SCSI channels as virtual controllers */
                     for (b = 1; b < ha->bus_cnt + 1; ++b) {
@@ -4375,11 +4016,7 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host
                 printk("Configuring GDT-EISA HA at Slot %d IRQ %u\n",
                         eisa_slot>>12,ha->irq);
 
-#if LINUX_VERSION_CODE >= 0x010346 
                 if (request_irq(ha->irq,gdth_interrupt,SA_INTERRUPT,"gdth",ha))
-#else
-                if (request_irq(ha->irq,gdth_interrupt,SA_INTERRUPT,"gdth")) 
-#endif
                 {
                     printk("GDT-EISA: Unable to allocate IRQ\n");
                     scsi_unregister(shp);
@@ -4399,7 +4036,6 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host
 
                 ha->pccb = CMDDATA(shp);
                 ha->ccb_phys = 0L; 
-#if LINUX_VERSION_CODE >= 0x020400
                 ha->pdev = NULL;
                 ha->pscratch = pci_alloc_consistent(ha->pdev, GDTH_SCRATCH, 
                                                     &scratch_dma_handle);
@@ -4407,12 +4043,6 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host
                 ha->ccb_phys = 
                     pci_map_single(ha->pdev,ha->pccb,
                                    sizeof(gdth_cmd_str),PCI_DMA_BIDIRECTIONAL);
-#else
-                ha->pscratch = scsi_init_malloc(GDTH_SCRATCH, GFP_ATOMIC | GFP_DMA);
-                if (ha->pscratch)
-                    ha->scratch_phys = virt_to_bus(ha->pscratch);
-                ha->ccb_phys = virt_to_bus(ha->pccb);
-#endif
                 ha->scratch_busy = FALSE;
                 ha->req_first = NULL;
                 ha->tid_cnt = MAX_HDRIVES;
@@ -4427,20 +4057,12 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host
                     --gdth_ctr_count;
                     --gdth_ctr_vcount;
                     if (ha->pscratch != NULL) {
-#if LINUX_VERSION_CODE >= 0x020400
                         pci_free_consistent(ha->pdev, GDTH_SCRATCH, 
                                             ha->pscratch, ha->scratch_phys);
                         pci_unmap_single(ha->pdev,ha->ccb_phys,
                                          sizeof(gdth_cmd_str),PCI_DMA_BIDIRECTIONAL);
-#else
-                        scsi_init_free((void *)ha->pscratch, GDTH_SCRATCH);
-#endif
                     }
-#if LINUX_VERSION_CODE >= 0x010346 
                     free_irq(ha->irq,ha);
-#else
-                    free_irq(ha->irq);
-#endif
                     scsi_unregister(shp);
                     continue;
                 }
@@ -4448,13 +4070,10 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host
                     hdr_channel = ha->bus_cnt;
                 ha->virt_bus = hdr_channel;
 
-#if LINUX_VERSION_CODE >= 0x020000
                 shp->max_id      = ha->tid_cnt;
                 shp->max_lun     = MAXLUN;
                 shp->max_channel = virt_ctr ? 0 : ha->bus_cnt;
-                if (virt_ctr)  
-#endif
-                {
+                if (virt_ctr) {
                     virt_ctr = 1;
                     /* register addit. SCSI channels as virtual controllers */
                     for (b = 1; b < ha->bus_cnt + 1; ++b) {
@@ -4475,10 +4094,6 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host
     }
 
     /* scanning for PCI controllers */
-#if LINUX_VERSION_CODE < 0x2015C
-    if (pcibios_present())
-#endif
-    {
         gdth_pci_str pcistr[MAXHA];
 
         cnt = gdth_search_pci(pcistr);
@@ -4502,14 +4117,8 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host
             printk("GDT CTR%d: Configuring GDT-PCI HA at %d/%d IRQ %u\n",
                    ctr,pcistr[ctr].bus,PCI_SLOT(pcistr[ctr].device_fn),ha->irq);
 
-#if LINUX_VERSION_CODE >= 0x010346 
-            if (request_irq(ha->irq, gdth_interrupt,
-                            SA_INTERRUPT|SA_SHIRQ, "gdth", ha))
-#else
             if (request_irq(ha->irq, gdth_interrupt,
-                            SA_INTERRUPT|SA_SHIRQ, "gdth")) 
-#endif
-            {
+                            SA_INTERRUPT|SA_SHIRQ, "gdth", ha)) {
                 printk("GDT-PCI: Unable to allocate IRQ\n");
                 scsi_unregister(shp);
                 continue;
@@ -4526,15 +4135,9 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host
 
             ha->pccb = CMDDATA(shp);
             ha->ccb_phys = 0L;
-#if LINUX_VERSION_CODE >= 0x020400
             ha->pscratch = pci_alloc_consistent(ha->pdev, GDTH_SCRATCH, 
                                                 &scratch_dma_handle);
             ha->scratch_phys = (ulong32)scratch_dma_handle;
-#else
-            ha->pscratch = scsi_init_malloc(GDTH_SCRATCH, GFP_ATOMIC | GFP_DMA);
-            if (ha->pscratch)
-                ha->scratch_phys = virt_to_bus(ha->pscratch);
-#endif
             ha->scratch_busy = FALSE;
             ha->req_first = NULL;
             ha->tid_cnt = pcistr[ctr].device_id >= 0x200 ? MAXID : MAX_HDRIVES;
@@ -4549,18 +4152,10 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host
                 --gdth_ctr_count;
                 --gdth_ctr_vcount;
                 if (ha->pscratch != NULL) {
-#if LINUX_VERSION_CODE >= 0x020400
                     pci_free_consistent(ha->pdev, GDTH_SCRATCH, 
                                         ha->pscratch, ha->scratch_phys);
-#else
-                    scsi_init_free((void *)ha->pscratch, GDTH_SCRATCH);
-#endif
                 }
-#if LINUX_VERSION_CODE >= 0x010346 
                 free_irq(ha->irq,ha);
-#else
-                free_irq(ha->irq);
-#endif
                 scsi_unregister(shp);
                 continue;
             }
@@ -4568,13 +4163,10 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host
                 hdr_channel = ha->bus_cnt;
             ha->virt_bus = hdr_channel;
 
-#if LINUX_VERSION_CODE >= 0x020000
             shp->max_id      = ha->tid_cnt;
             shp->max_lun     = MAXLUN;
             shp->max_channel = virt_ctr ? 0 : ha->bus_cnt;
-            if (virt_ctr)  
-#endif
-            {
+            if (virt_ctr) {
                 virt_ctr = 1;
                 /* register addit. SCSI channels as virtual controllers */
                 for (b = 1; b < ha->bus_cnt + 1; ++b) {
@@ -4591,7 +4183,6 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host
             GDTH_INIT_LOCK_HA(ha);
             gdth_enable_int(hanum);
         }
-    }
 
     TRACE2(("gdth_detect() %d controller detected\n",gdth_ctr_count));
     if (gdth_ctr_count > 0) {
@@ -4606,9 +4197,7 @@ GDTH_INITFUNC(int, gdth_detect(Scsi_Host
 #ifdef GDTH_IOCTL_CHRDEV
         major = register_chrdev(0,"gdth",&gdth_fops);
 #endif
-#if LINUX_VERSION_CODE >= 0x020100
         register_reboot_notifier(&gdth_notifier);
-#endif
     }
     gdth_polling = FALSE;
     return gdth_ctr_vcount;
@@ -4624,31 +4213,21 @@ int gdth_release(struct Scsi_Host *shp)
     if (NUMDATA(shp)->busnum == 0) {
         hanum = NUMDATA(shp)->hanum;
         ha    = HADATA(gdth_ctr_tab[hanum]);
-#if LINUX_VERSION_CODE >= 0x010300
         gdth_flush(hanum);
-#endif
 
         if (shp->irq) {
-#if LINUX_VERSION_CODE >= 0x010346
             free_irq(shp->irq,ha);
-#else
-            free_irq(shp->irq);
-#endif
         }
 #ifndef __ia64__
         if (shp->dma_channel != 0xff) {
             free_dma(shp->dma_channel);
         }
 #endif
-#if LINUX_VERSION_CODE >= 0x020400
         pci_free_consistent(ha->pdev, GDTH_SCRATCH, 
             ha->pscratch, ha->scratch_phys);
         if (ha->ccb_phys)
             pci_unmap_single(ha->pdev,ha->ccb_phys,
                              sizeof(gdth_cmd_str),PCI_DMA_BIDIRECTIONAL);
-#else
-        scsi_init_free((void *)ha->pscratch, GDTH_SCRATCH);
-#endif
         gdth_ctr_released++;
         TRACE2(("gdth_release(): HA %d of %d\n", 
                 gdth_ctr_released, gdth_ctr_count));
@@ -4660,9 +4239,7 @@ int gdth_release(struct Scsi_Host *shp)
 #ifdef GDTH_IOCTL_CHRDEV
             unregister_chrdev(major,"gdth");
 #endif
-#if LINUX_VERSION_CODE >= 0x020100
             unregister_reboot_notifier(&gdth_notifier);
-#endif
         }
     }
 
@@ -4722,17 +4299,12 @@ int gdth_abort(Scsi_Cmnd *scp)
     return SCSI_ABORT_SNOOZE;
 }
 
-#if LINUX_VERSION_CODE >= 0x010346
 int gdth_reset(Scsi_Cmnd *scp, unsigned int reset_flags)
-#else
-int gdth_reset(Scsi_Cmnd *scp)
-#endif
 {
     TRACE2(("gdth_reset()\n"));
     return SCSI_RESET_PUNT;
 }
 
-#if LINUX_VERSION_CODE >= 0x02015F
 /* new error handling */
 int gdth_eh_abort(Scsi_Cmnd *scp)
 {
@@ -4813,15 +4385,12 @@ int gdth_eh_host_reset(Scsi_Cmnd *scp)
     TRACE2(("gdth_eh_host_reset()\n"));
     return FAILED;
 }
-#endif
 
 
 #if LINUX_VERSION_CODE >= 0x020503
 int gdth_bios_param(struct scsi_device *sdev,struct block_device *bdev,sector_t cap,int *ip)
-#elif LINUX_VERSION_CODE >= 0x010300
-int gdth_bios_param(Disk *disk,kdev_t dev,int *ip)
 #else
-int gdth_bios_param(Disk *disk,int dev,int *ip)
+int gdth_bios_param(Disk *disk,kdev_t dev,int *ip)
 #endif
 {
     unchar b, t;
@@ -4882,10 +4451,8 @@ int gdth_queuecommand(Scsi_Cmnd *scp,voi
 #endif
 
     priority = DEFAULT_PRI;
-#if LINUX_VERSION_CODE >= 0x010300
     if (scp->done == gdth_scsi_done)
         priority = scp->SCp.this_residual;
-#endif
     gdth_update_timeout(hanum, scp, scp->timeout_per_command * 6);
     gdth_putq( hanum, scp, priority );
     gdth_next( hanum );
@@ -4980,15 +4547,11 @@ static int ioc_resetdrv(unsigned long ar
         gdth_cmd_str cmd;
         int hanum;
         gdth_ha_str *ha;
+	Scsi_Device *sdev;
 #if LINUX_VERSION_CODE >= 0x020503
 	Scsi_Request *srp;
-	Scsi_Device *sdev;
-#elif LINUX_VERSION_CODE >= 0x020322
-	Scsi_Cmnd *scp;
-	Scsi_Device *sdev;
 #else
-	Scsi_Cmnd scp;
-	Scsi_Device sdev;
+	Scsi_Cmnd *scp;
 #endif
 
         if (copy_from_user(&res, (char *)arg, sizeof(gdth_ioctl_reset)) ||
@@ -5002,8 +4565,8 @@ static int ioc_resetdrv(unsigned long ar
         cmd.Service = CACHESERVICE;
         cmd.OpCode = GDT_CLUST_RESET;
         cmd.u.cache.DeviceNo = res.number;
-#if LINUX_VERSION_CODE >= 0x020503
         sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
+#if LINUX_VERSION_CODE >= 0x020503
         srp  = scsi_allocate_request(sdev, GFP_KERNEL);
         if (!srp)
             return -ENOMEM;
@@ -5012,9 +4575,7 @@ static int ioc_resetdrv(unsigned long ar
         gdth_do_req(srp, &cmd, cmnd, 30);
         res.status = (ushort)srp->sr_command->SCp.Status;
         scsi_release_request(srp);
-        scsi_free_host_dev(sdev);
-#elif LINUX_VERSION_CODE >= 0x020322
-        sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
+#else
         scp  = scsi_allocate_device(sdev, 1, FALSE);
         if (!scp)
             return -ENOMEM;
@@ -5023,16 +4584,8 @@ static int ioc_resetdrv(unsigned long ar
         gdth_do_cmd(scp, &cmd, cmnd, 30);
         res.status = (ushort)scp->SCp.Status;
         scsi_release_command(scp);
-        scsi_free_host_dev(sdev);
-#else
-        memset(&sdev,0,sizeof(Scsi_Device));
-        memset(&scp, 0,sizeof(Scsi_Cmnd));
-        sdev.host = scp.host = gdth_ctr_tab[hanum];
-        sdev.id = scp.target = sdev.host->this_id;
-        scp.device = &sdev;
-        gdth_do_cmd(&scp, &cmd, cmnd, 30);
-        res.status = (ushort)scp.SCp.Status;
 #endif
+        scsi_free_host_dev(sdev);
         if (copy_to_user((char *)arg, &res, sizeof(gdth_ioctl_reset)))
             return -EFAULT;
         return 0;
@@ -5045,15 +4598,11 @@ static int ioc_general(unsigned long arg
         ulong32 paddr; 
         int hanum;
 	gdth_ha_str *ha; 
+	Scsi_Device *sdev;
 #if LINUX_VERSION_CODE >= 0x020503
 	Scsi_Request *srp;
-	Scsi_Device *sdev;
-#elif LINUX_VERSION_CODE >= 0x020322
-	Scsi_Cmnd *scp;
-	Scsi_Device *sdev;
 #else
-	Scsi_Cmnd scp;
-	Scsi_Device sdev;
+	Scsi_Cmnd *scp;
 #endif
         
         if (copy_from_user(&gen, (char *)arg, sizeof(gdth_ioctl_general)) ||
@@ -5103,8 +4652,8 @@ static int ioc_general(unsigned long arg
             }
         }
 
-#if LINUX_VERSION_CODE >= 0x020503
         sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
+#if LINUX_VERSION_CODE >= 0x020503
         srp  = scsi_allocate_request(sdev, GFP_KERNEL);
         if (!srp)
             return -ENOMEM;
@@ -5114,9 +4663,7 @@ static int ioc_general(unsigned long arg
         gen.status = srp->sr_command->SCp.Status;
         gen.info = srp->sr_command->SCp.Message;
         scsi_release_request(srp);
-        scsi_free_host_dev(sdev);
-#elif LINUX_VERSION_CODE >= 0x020322
-        sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
+#else
         scp  = scsi_allocate_device(sdev, 1, FALSE);
         if (!scp)
             return -ENOMEM;
@@ -5126,17 +4673,8 @@ static int ioc_general(unsigned long arg
         gen.status = scp->SCp.Status;
         gen.info = scp->SCp.Message;
         scsi_release_command(scp);
-        scsi_free_host_dev(sdev);
-#else
-        memset(&sdev,0,sizeof(Scsi_Device));
-        memset(&scp, 0,sizeof(Scsi_Cmnd));
-        sdev.host = scp.host = gdth_ctr_tab[hanum];
-        sdev.id = scp.target = sdev.host->this_id;
-        scp.device = &sdev;
-        gdth_do_cmd(&scp, &gen.command, cmnd, gen.timeout);
-        gen.status = scp.SCp.Status;
-        gen.info = scp.SCp.Message;
 #endif
+        scsi_free_host_dev(sdev);
 
         if (copy_to_user((char *)arg + sizeof(gdth_ioctl_general), buf, 
                          gen.data_len + gen.sense_len)) {
@@ -5159,15 +4697,11 @@ static int ioc_hdrlist(unsigned long arg
         gdth_ha_str *ha;
         unchar i;
         int hanum;
+	Scsi_Device *sdev;
 #if LINUX_VERSION_CODE >= 0x020503
 	Scsi_Request *srp;
-	Scsi_Device *sdev;
-#elif LINUX_VERSION_CODE >= 0x020322
-	Scsi_Cmnd *scp;
-	Scsi_Device *sdev;
 #else
-	Scsi_Cmnd scp;
-	Scsi_Device sdev;
+	Scsi_Cmnd *scp;
 #endif
         
         if (copy_from_user(&rsc, (char *)arg, sizeof(gdth_ioctl_rescan)) ||
@@ -5176,26 +4710,19 @@ static int ioc_hdrlist(unsigned long arg
         hanum = rsc.ionode;
         ha = HADATA(gdth_ctr_tab[hanum]);
    
-#if LINUX_VERSION_CODE >= 0x020503
         sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
+#if LINUX_VERSION_CODE >= 0x020503
         srp  = scsi_allocate_request(sdev, GFP_KERNEL);
         if (!srp)
             return -ENOMEM;
         srp->sr_cmd_len = 12;
         srp->sr_use_sg = 0;
-#elif LINUX_VERSION_CODE >= 0x020322
-        sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
+#else
         scp  = scsi_allocate_device(sdev, 1, FALSE);
         if (!scp)
             return -ENOMEM;
         scp->cmd_len = 12;
         scp->use_sg = 0;
-#else
-        memset(&sdev,0,sizeof(Scsi_Device));
-        memset(&scp, 0,sizeof(Scsi_Cmnd));
-        sdev.host = scp.host = gdth_ctr_tab[hanum];
-        sdev.id = scp.target = sdev.host->this_id;
-        scp.device = &sdev;
 #endif
 
         for (i = 0; i < MAX_HDRIVES; ++i) { 
@@ -5215,24 +4742,19 @@ static int ioc_hdrlist(unsigned long arg
                 gdth_do_req(srp, &cmd, cmnd, 30);
                 if (srp->sr_command->SCp.Status == S_OK)
                     rsc.hdr_list[i].cluster_type = srp->sr_command->SCp.Message;
-#elif LINUX_VERSION_CODE >= 0x020322
+#else
                 gdth_do_cmd(scp, &cmd, cmnd, 30);
                 if (scp->SCp.Status == S_OK)
                     rsc.hdr_list[i].cluster_type = scp->SCp.Message;
-#else
-                gdth_do_cmd(&scp, &cmd, cmnd, 30);
-                if (scp.SCp.Status == S_OK)
-                    rsc.hdr_list[i].cluster_type = scp.SCp.Message;
 #endif
             }
         } 
 #if LINUX_VERSION_CODE >= 0x020503
         scsi_release_request(srp);
-        scsi_free_host_dev(sdev);
-#elif LINUX_VERSION_CODE >= 0x020322
+#else
         scsi_release_command(scp);
-        scsi_free_host_dev(sdev);
 #endif       
+        scsi_free_host_dev(sdev);
  
         if (copy_to_user((char *)arg, &rsc, sizeof(gdth_ioctl_rescan)))
             return -EFAULT;
@@ -5248,15 +4770,11 @@ static int ioc_rescan(unsigned long arg,
         int hanum, cyls, hds, secs;
 	ulong flags;
 	gdth_ha_str *ha; 
+	Scsi_Device *sdev;
 #if LINUX_VERSION_CODE >= 0x020503
 	Scsi_Request *srp;
-	Scsi_Device *sdev;
-#elif LINUX_VERSION_CODE >= 0x020322
-	Scsi_Cmnd *scp;
-	Scsi_Device *sdev;
 #else
-	Scsi_Cmnd scp;
-	Scsi_Device sdev;
+	Scsi_Cmnd *scp;
 #endif
         
         if (copy_from_user(&rsc, (char *)arg, sizeof(gdth_ioctl_rescan)) ||
@@ -5265,26 +4783,19 @@ static int ioc_rescan(unsigned long arg,
         hanum = rsc.ionode;
         ha = HADATA(gdth_ctr_tab[hanum]);
 
-#if LINUX_VERSION_CODE >= 0x020503
         sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
+#if LINUX_VERSION_CODE >= 0x020503
         srp  = scsi_allocate_request(sdev, GFP_KERNEL);
         if (!srp)
             return -ENOMEM;
         srp->sr_cmd_len = 12;
         srp->sr_use_sg = 0;
-#elif LINUX_VERSION_CODE >= 0x020322
-        sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
+#else
         scp  = scsi_allocate_device(sdev, 1, FALSE);
         if (!scp)
             return -ENOMEM;
         scp->cmd_len = 12;
         scp->use_sg = 0;
-#else
-        memset(&sdev,0,sizeof(Scsi_Device));
-        memset(&scp, 0,sizeof(Scsi_Cmnd));
-        sdev.host = scp.host = gdth_ctr_tab[hanum];
-        sdev.id = scp.target = sdev.host->this_id;
-        scp.device = &sdev;
 #endif
      
         if (rsc.flag == 0) {
@@ -5296,14 +4807,10 @@ static int ioc_rescan(unsigned long arg,
             gdth_do_req(srp, &cmd, cmnd, 30);
             status = (ushort)srp->sr_command->SCp.Status;
             info = (ulong32)srp->sr_command->SCp.Message;
-#elif LINUX_VERSION_CODE >= 0x020322
+#else
             gdth_do_cmd(scp, &cmd, cmnd, 30);
             status = (ushort)scp->SCp.Status;
             info = (ulong32)scp->SCp.Message;
-#else
-            gdth_do_cmd(&scp, &cmd, cmnd, 30);
-            status = (ushort)scp.SCp.Status;
-            info = (ulong32)scp.SCp.Message;
 #endif
             i = 0;
             hdr_cnt = (status == S_OK ? (ushort)info : 0);
@@ -5319,14 +4826,10 @@ static int ioc_rescan(unsigned long arg,
             gdth_do_req(srp, &cmd, cmnd, 30);
             status = (ushort)srp->sr_command->SCp.Status;
             info = (ulong32)srp->sr_command->SCp.Message;
-#elif LINUX_VERSION_CODE >= 0x020322
+#else
             gdth_do_cmd(scp, &cmd, cmnd, 30);
             status = (ushort)scp->SCp.Status;
             info = (ulong32)scp->SCp.Message;
-#else
-            gdth_do_cmd(&scp, &cmd, cmnd, 30);
-            status = (ushort)scp.SCp.Status;
-            info = (ulong32)scp.SCp.Message;
 #endif
             GDTH_LOCK_HA(ha, flags);
             rsc.hdr_list[i].bus = ha->virt_bus;
@@ -5357,14 +4860,10 @@ static int ioc_rescan(unsigned long arg,
             gdth_do_req(srp, &cmd, cmnd, 30);
             status = (ushort)srp->sr_command->SCp.Status;
             info = (ulong32)srp->sr_command->SCp.Message;
-#elif LINUX_VERSION_CODE >= 0x020322
+#else
             gdth_do_cmd(scp, &cmd, cmnd, 30);
             status = (ushort)scp->SCp.Status;
             info = (ulong32)scp->SCp.Message;
-#else
-            gdth_do_cmd(&scp, &cmd, cmnd, 30);
-            status = (ushort)scp.SCp.Status;
-            info = (ulong32)scp.SCp.Message;
 #endif
             GDTH_LOCK_HA(ha, flags);
             ha->hdr[i].devtype = (status == S_OK ? (ushort)info : 0);
@@ -5377,14 +4876,10 @@ static int ioc_rescan(unsigned long arg,
             gdth_do_req(srp, &cmd, cmnd, 30);
             status = (ushort)srp->sr_command->SCp.Status;
             info = (ulong32)srp->sr_command->SCp.Message;
-#elif LINUX_VERSION_CODE >= 0x020322
+#else
             gdth_do_cmd(scp, &cmd, cmnd, 30);
             status = (ushort)scp->SCp.Status;
             info = (ulong32)scp->SCp.Message;
-#else
-            gdth_do_cmd(&scp, &cmd, cmnd, 30);
-            status = (ushort)scp.SCp.Status;
-            info = (ulong32)scp.SCp.Message;
 #endif
             GDTH_LOCK_HA(ha, flags);
             ha->hdr[i].cluster_type = 
@@ -5399,14 +4894,10 @@ static int ioc_rescan(unsigned long arg,
             gdth_do_req(srp, &cmd, cmnd, 30);
             status = (ushort)srp->sr_command->SCp.Status;
             info = (ulong32)srp->sr_command->SCp.Message;
-#elif LINUX_VERSION_CODE >= 0x020322
+#else
             gdth_do_cmd(scp, &cmd, cmnd, 30);
             status = (ushort)scp->SCp.Status;
             info = (ulong32)scp->SCp.Message;
-#else
-            gdth_do_cmd(&scp, &cmd, cmnd, 30);
-            status = (ushort)scp.SCp.Status;
-            info = (ulong32)scp.SCp.Message;
 #endif
             GDTH_LOCK_HA(ha, flags);
             ha->hdr[i].rw_attribs = (status == S_OK ? (ushort)info : 0);
@@ -5414,11 +4905,10 @@ static int ioc_rescan(unsigned long arg,
         }
 #if LINUX_VERSION_CODE >= 0x020503
         scsi_release_request(srp);
-        scsi_free_host_dev(sdev);
-#elif LINUX_VERSION_CODE >= 0x020322
+#else
         scsi_release_command(scp);
-        scsi_free_host_dev(sdev);
 #endif       
+        scsi_free_host_dev(sdev);
  
         if (copy_to_user((char *)arg, &rsc, sizeof(gdth_ioctl_rescan)))
             return -EFAULT;
@@ -5429,16 +4919,8 @@ static int gdth_ioctl(struct inode *inod
                       unsigned int cmd, unsigned long arg)
 {
     gdth_ha_str *ha; 
-#if LINUX_VERSION_CODE >= 0x020503
     Scsi_Cmnd *scp;
     Scsi_Device *sdev;
-#elif LINUX_VERSION_CODE >= 0x020322
-    Scsi_Cmnd *scp;
-    Scsi_Device *sdev;
-#else
-    Scsi_Cmnd scp;
-    Scsi_Device sdev;
-#endif
     ulong flags;
     char cmnd[MAX_COMMAND_SIZE];   
 
@@ -5565,8 +5047,8 @@ static int gdth_ioctl(struct inode *inod
         hanum = res.ionode; 
 
         /* Because we need a Scsi_Cmnd struct., we make a scsi_allocate device also for kernels >=2.5.x */        
-#if LINUX_VERSION_CODE >= 0x02053C
         sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
+#if LINUX_VERSION_CODE >= 0x02053C
         scp  = scsi_get_command(sdev, GFP_KERNEL);
         if (!scp)
             return -ENOMEM;
@@ -5576,9 +5058,7 @@ static int gdth_ioctl(struct inode *inod
         rval = gdth_eh_bus_reset(scp);
         res.status = (rval == SUCCESS ? S_OK : S_GENERR);
         scsi_put_command(scp);
-        scsi_free_host_dev(sdev);
-#elif LINUX_VERSION_CODE >= 0x020322
-        sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
+#else
 #if LINUX_VERSION_CODE >= 0x020503
         scp  = scsi_allocate_device(sdev, 1);
 #else
@@ -5592,19 +5072,8 @@ static int gdth_ioctl(struct inode *inod
         rval = gdth_eh_bus_reset(scp);
         res.status = (rval == SUCCESS ? S_OK : S_GENERR);
         scsi_release_command(scp);
-        scsi_free_host_dev(sdev);
-#elif LINUX_VERSION_CODE >= 0x02015F
-        memset(&sdev,0,sizeof(Scsi_Device));
-        memset(&scp, 0,sizeof(Scsi_Cmnd));
-        sdev.host = scp.host = gdth_ctr_tab[hanum];
-        sdev.id = scp.target = sdev.host->this_id;
-        scp.device = &sdev;
-        scp.channel = virt_ctr ? 0 : res.number;
-        rval = gdth_eh_bus_reset(&scp);
-        res.status = (rval == SUCCESS ? S_OK : S_GENERR);
-#else
-        res.status = S_OK;
 #endif
+        scsi_free_host_dev(sdev);
         if (copy_to_user((char *)arg, &res, sizeof(gdth_ioctl_reset)))
             return -EFAULT;
         break;
@@ -5620,22 +5089,17 @@ static int gdth_ioctl(struct inode *inod
 }
 #endif
 
-#if LINUX_VERSION_CODE >= 0x010300
 /* flush routine */
 static void gdth_flush(int hanum)
 {
     int             i;
     gdth_ha_str     *ha;
     gdth_cmd_str    gdtcmd;
+    Scsi_Device     *sdev;
 #if LINUX_VERSION_CODE >= 0x020503
     Scsi_Request    *srp;
-    Scsi_Device     *sdev;
-#elif LINUX_VERSION_CODE >= 0x020322
-    Scsi_Cmnd       *scp;
-    Scsi_Device     *sdev;
 #else
-    Scsi_Cmnd       scp;
-    Scsi_Device     sdev;
+    Scsi_Cmnd       *scp;
 #endif
     char            cmnd[MAX_COMMAND_SIZE];   
     memset(cmnd, 0xff, MAX_COMMAND_SIZE);
@@ -5643,26 +5107,19 @@ static void gdth_flush(int hanum)
     TRACE2(("gdth_flush() hanum %d\n",hanum));
     ha = HADATA(gdth_ctr_tab[hanum]);
 
-#if LINUX_VERSION_CODE >= 0x020503
     sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
+#if LINUX_VERSION_CODE >= 0x020503
     srp  = scsi_allocate_request(sdev, GFP_KERNEL);
     if (!srp)
         return;
     srp->sr_cmd_len = 12;
     srp->sr_use_sg = 0;
-#elif LINUX_VERSION_CODE >= 0x020322
-    sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
+#else
     scp  = scsi_allocate_device(sdev, 1, FALSE);
     if (!scp)
         return;
     scp->cmd_len = 12;
     scp->use_sg = 0;
-#else
-    memset(&sdev,0,sizeof(Scsi_Device));
-    memset(&scp, 0,sizeof(Scsi_Cmnd));
-    sdev.host = scp.host = gdth_ctr_tab[hanum];
-    sdev.id = scp.target = sdev.host->this_id;
-    scp.device = &sdev;
 #endif
 
     for (i = 0; i < MAX_HDRIVES; ++i) {
@@ -5676,57 +5133,37 @@ static void gdth_flush(int hanum)
             TRACE2(("gdth_flush(): flush ha %d drive %d\n", hanum, i));
 #if LINUX_VERSION_CODE >= 0x020503
             gdth_do_req(srp, &gdtcmd, cmnd, 30);
-#elif LINUX_VERSION_CODE >= 0x020322
-            gdth_do_cmd(scp, &gdtcmd, cmnd, 30);
 #else
-            gdth_do_cmd(&scp, &gdtcmd, cmnd, 30);
+            gdth_do_cmd(scp, &gdtcmd, cmnd, 30);
 #endif
         }
     }
 #if LINUX_VERSION_CODE >= 0x020503
     scsi_release_request(srp);
-    scsi_free_host_dev(sdev);
-#elif LINUX_VERSION_CODE >= 0x020322
+#else
     scsi_release_command(scp);
-    scsi_free_host_dev(sdev);
 #endif
+    scsi_free_host_dev(sdev);
 }
 
 /* shutdown routine */
-#if LINUX_VERSION_CODE >= 0x020100
 static int gdth_halt(struct notifier_block *nb, ulong event, void *buf)
-#else
-void gdth_halt(void)
-#endif
 {
     int             hanum;
 #ifndef __alpha__
     gdth_cmd_str    gdtcmd;
+    Scsi_Device     *sdev;
 #if LINUX_VERSION_CODE >= 0x020503
     Scsi_Request    *srp;
-    Scsi_Device     *sdev;
-#elif LINUX_VERSION_CODE >= 0x020322
-    Scsi_Cmnd       *scp;
-    Scsi_Device     *sdev;
 #else
-    Scsi_Cmnd       scp;
-    Scsi_Device     sdev;
+    Scsi_Cmnd       *scp;
 #endif
     char            cmnd[MAX_COMMAND_SIZE];   
 #endif
 
-#if LINUX_VERSION_CODE >= 0x020100
     TRACE2(("gdth_halt() event %d\n",(int)event));
     if (event != SYS_RESTART && event != SYS_HALT && event != SYS_POWER_OFF)
         return NOTIFY_DONE;
-#else
-    TRACE2(("gdth_halt()\n"));
-    if (halt_called) {
-        TRACE2(("already called\n"));
-        return;
-    }
-    halt_called = TRUE;
-#endif
 
     printk("GDT: Flushing all host drives .. ");
     for (hanum = 0; hanum < gdth_ctr_count; ++hanum) {
@@ -5739,78 +5176,43 @@ void gdth_halt(void)
         gdtcmd.Service = CACHESERVICE;
         gdtcmd.OpCode = GDT_RESET;
         TRACE2(("gdth_halt(): reset controller %d\n", hanum));
-#if LINUX_VERSION_CODE >= 0x020503
         sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
+#if LINUX_VERSION_CODE >= 0x020503
         srp  = scsi_allocate_request(sdev, GFP_KERNEL);
         if (!srp) {
-#if LINUX_VERSION_CODE >= 0x020100
             unregister_reboot_notifier(&gdth_notifier);
             return NOTIFY_OK;
-#else
-            return;
-#endif
         }
         srp->sr_cmd_len = 12;
         srp->sr_use_sg = 0;
         gdth_do_req(srp, &gdtcmd, cmnd, 10);
         scsi_release_request(srp);
-        scsi_free_host_dev(sdev);
-#elif LINUX_VERSION_CODE >= 0x020322
-        sdev = scsi_get_host_dev(gdth_ctr_tab[hanum]);
+#else
         scp  = scsi_allocate_device(sdev, 1, FALSE);
         if (!scp) {
-#if LINUX_VERSION_CODE >= 0x020100
             unregister_reboot_notifier(&gdth_notifier);
             return NOTIFY_OK;
-#else
-            return;
-#endif
         }
         scp->cmd_len = 12;
         scp->use_sg = 0;
         gdth_do_cmd(scp, &gdtcmd, cmnd, 10);
         scsi_release_command(scp);
-        scsi_free_host_dev(sdev);
-#else
-        memset(&sdev,0,sizeof(Scsi_Device));
-        memset(&scp, 0,sizeof(Scsi_Cmnd));
-        sdev.host = scp.host = gdth_ctr_tab[hanum];
-        sdev.id = scp.target = sdev.host->this_id;
-        scp.device = &sdev;
-        gdth_do_cmd(&scp, &gdtcmd, cmnd, 10);
 #endif
 #endif
+        scsi_free_host_dev(sdev);
     }
     printk("Done.\n");
 
 #ifdef GDTH_STATISTICS
     del_timer(&gdth_timer);
 #endif
-#if LINUX_VERSION_CODE >= 0x020100
     unregister_reboot_notifier(&gdth_notifier);
     return NOTIFY_OK;
-#endif
 }
-#endif
 
 
-#if LINUX_VERSION_CODE < 0x020400 && !defined(MODULE)
-
-GDTH_INITFUNC(void, gdth_setup(char *str,int *ints)) 
-{    
-    TRACE2(("gdth_setup() str %s ints[0] %d\n", 
-            str ? str:"NULL", ints ? ints[0]:0));
-    internal_setup(str, ints);
-}
-
-#else
-
 static Scsi_Host_Template driver_template = {
-#if LINUX_VERSION_CODE >= 0x02015F
 	.proc_name		= "gdth", 
-#else
-	.proc_dir		= &proc_scsi_gdth,
-#endif
 	.proc_info		= gdth_proc_info,
 	.name			= "GDT SCSI Disk Array Controller",
 	.detect			= gdth_detect, 
@@ -5834,8 +5236,4 @@ static Scsi_Host_Template driver_templat
 };
 
 #include "scsi_module.c"
-#ifndef MODULE
 __setup("gdth=", option_setup);
-#endif
-
-#endif
