This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / scsi / t128.c
index 6dc2897..7e73fc2 100644 (file)
@@ -199,7 +199,6 @@ int __init t128_detect(Scsi_Host_Template * tpnt){
     static int current_override = 0, current_base = 0;
     struct Scsi_Host *instance;
     unsigned long base;
-    void __iomem *p;
     int sig, count;
 
     tpnt->proc_name = "t128";
@@ -207,34 +206,26 @@ int __init t128_detect(Scsi_Host_Template * tpnt){
 
     for (count = 0; current_override < NO_OVERRIDES; ++current_override) {
        base = 0;
-       p = NULL;
 
-       if (overrides[current_override].address) {
+       if (overrides[current_override].address)
            base = overrides[current_override].address;
-           p = ioremap(bases[current_base].address, 0x2000);
-           if (!p)
-               base = 0;
-       } else 
+       else 
            for (; !base && (current_base < NO_BASES); ++current_base) {
 #if (TDEBUG & TDEBUG_INIT)
     printk("scsi-t128 : probing address %08x\n", bases[current_base].address);
 #endif
-               if (bases[current_base].noauto)
-                       continue;
-               p = ioremap(bases[current_base].address, 0x2000);
-               if (!p)
-                       continue;
                for (sig = 0; sig < NO_SIGNATURES; ++sig) 
-                   if (check_signature(p + signatures[sig].offset,
+                   if (!bases[current_base].noauto && 
+                       isa_check_signature(bases[current_base].address +
+                                       signatures[sig].offset,
                                        signatures[sig].string,
                                        strlen(signatures[sig].string))) {
                        base = bases[current_base].address;
 #if (TDEBUG & TDEBUG_INIT)
                        printk("scsi-t128 : detected board.\n");
 #endif
-                       goto found;
+                       break;
                    }
-               iounmap(p);
            }
 
 #if defined(TDEBUG) && (TDEBUG & TDEBUG_INIT)
@@ -244,13 +235,11 @@ int __init t128_detect(Scsi_Host_Template * tpnt){
        if (!base)
            break;
 
-found:
        instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
        if(instance == NULL)
                break;
                
        instance->base = base;
-       ((struct NCR5380_hostdata *)instance->hostdata)->base = p;
 
        NCR5380_init(instance, 0);
 
@@ -293,15 +282,12 @@ found:
 
 static int t128_release(struct Scsi_Host *shost)
 {
-       NCR5380_local_declare();
-       NCR5380_setup(shost);
        if (shost->irq)
                free_irq(shost->irq, NULL);
        NCR5380_exit(shost);
        if (shost->io_port && shost->n_io_port)
                release_region(shost->io_port, shost->n_io_port);
        scsi_unregister(shost);
-       iounmap(base);
        return 0;
 }
 
@@ -349,30 +335,28 @@ int t128_biosparam(struct scsi_device *sdev, struct block_device *bdev,
 
 static inline int NCR5380_pread (struct Scsi_Host *instance, unsigned char *dst,
     int len) {
-    NCR5380_local_declare();
-    void __iomem *reg;
+    unsigned long reg = instance->base + T_DATA_REG_OFFSET;
     unsigned char *d = dst;
     register int i = len;
 
-    NCR5380_setup(instance);
-    reg = base + T_DATA_REG_OFFSET;
 
 #if 0
     for (; i; --i) {
-       while (!(readb(base+T_STATUS_REG_OFFSET) & T_ST_RDY)) barrier();
+       while (!(isa_readb(instance->base+T_STATUS_REG_OFFSET) & T_ST_RDY)) barrier();
 #else
-    while (!(readb(base+T_STATUS_REG_OFFSET) & T_ST_RDY)) barrier();
+    while (!(isa_readb(instance->base+T_STATUS_REG_OFFSET) & T_ST_RDY)) barrier();
     for (; i; --i) {
 #endif
-       *d++ = readb(reg);
+       *d++ = isa_readb(reg);
     }
 
-    if (readb(base + T_STATUS_REG_OFFSET) & T_ST_TIM) {
+    if (isa_readb(instance->base + T_STATUS_REG_OFFSET) & T_ST_TIM) {
        unsigned char tmp;
-       void __iomem *foo = base + T_CONTROL_REG_OFFSET;
-       tmp = readb(foo);
-       writeb(tmp | T_CR_CT, foo);
-       writeb(tmp, foo);
+       unsigned long foo;
+       foo = instance->base + T_CONTROL_REG_OFFSET;
+       tmp = isa_readb(foo);
+       isa_writeb(tmp | T_CR_CT, foo);
+       isa_writeb(tmp, foo);
        printk("scsi%d : watchdog timer fired in NCR5380_pread()\n",
            instance->host_no);
        return -1;
@@ -395,30 +379,27 @@ static inline int NCR5380_pread (struct Scsi_Host *instance, unsigned char *dst,
 
 static inline int NCR5380_pwrite (struct Scsi_Host *instance, unsigned char *src,
     int len) {
-    NCR5380_local_declare();
-    void __iomem *reg;
+    unsigned long reg = instance->base + T_DATA_REG_OFFSET;
     unsigned char *s = src;
     register int i = len;
 
-    NCR5380_setup(instance);
-    reg = base + T_DATA_REG_OFFSET;
-
 #if 0
     for (; i; --i) {
-       while (!(readb(base+T_STATUS_REG_OFFSET) & T_ST_RDY)) barrier();
+       while (!(isa_readb(instance->base+T_STATUS_REG_OFFSET) & T_ST_RDY)) barrier();
 #else
-    while (!(readb(base+T_STATUS_REG_OFFSET) & T_ST_RDY)) barrier();
+    while (!(isa_readb(instance->base+T_STATUS_REG_OFFSET) & T_ST_RDY)) barrier();
     for (; i; --i) {
 #endif
-       writeb(*s++, reg);
+       isa_writeb(*s++, reg);
     }
 
-    if (readb(base + T_STATUS_REG_OFFSET) & T_ST_TIM) {
+    if (isa_readb(instance->base + T_STATUS_REG_OFFSET) & T_ST_TIM) {
        unsigned char tmp;
-       void __iomem *foo = base + T_CONTROL_REG_OFFSET;
-       tmp = readb(foo);
-       writeb(tmp | T_CR_CT, foo);
-       writeb(tmp, foo);
+       unsigned long foo;
+       foo = instance->base + T_CONTROL_REG_OFFSET;
+       tmp = isa_readb(foo);
+       isa_writeb(tmp | T_CR_CT, foo);
+       isa_writeb(tmp, foo);
        printk("scsi%d : watchdog timer fired in NCR5380_pwrite()\n",
            instance->host_no);
        return -1;