Skip to contentSkip to conversation

removed useless SCSI_GENERIC_NCR5380_MMIO

PATCH In review Adrian Bunk 3 participants 4 messages Nov 12, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 removed useless SCSI_GENERIC_NCR5380_MMIO

This patch removes the useless SCSI_GENERIC_NCR5380_MMIO.

It's useless, since SCSI_G_NCR5380_MEM != CONFIG_SCSI_G_NCR5380_MEM.

This issue exists at least since kernel 2.6.0 and since it seems noone noticed it I'd say we can safely remove it.

---

 drivers/scsi/Kconfig          |   14 -------------
 drivers/scsi/Makefile         |    1 
 drivers/scsi/g_NCR5380.c      |   36 ----------------------------------
 drivers/scsi/g_NCR5380.h      |   19 -----------------
 drivers/scsi/g_NCR5380_mmio.c |   10 ---------
 5 files changed, 80 deletions(-)
drivers/scsi/Kconfig renamed from drivers/scsi/Kconfig.old +0 -14
@@ -846,20 +846,6 @@
 	  To compile this driver as a module, choose M here: the
 	  module will be called g_NCR5380.
 
-config SCSI_GENERIC_NCR5380_MMIO
-	tristate "Generic NCR5380/53c400 SCSI MMIO support"
-	depends on ISA && SCSI
-	---help---
-	  This is a driver for the old NCR 53c80 series of SCSI controllers
-	  on boards using memory mapped I/O. 
-	  It is explained in section 3.8 of the SCSI-HOWTO, available from
-	  <http://www.tldp.org/docs.html#howto>.  If it doesn't work out
-	  of the box, you may have to change some settings in
-	  <file:drivers/scsi/g_NCR5380.h>.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called g_NCR5380_mmio.
-
 config SCSI_GENERIC_NCR53C400
 	bool "Enable NCR53c400 extensions"
 	depends on SCSI_GENERIC_NCR5380
drivers/scsi/Makefile renamed from drivers/scsi/Makefile.old +0 -1
@@ -74,7 +74,6 @@
 obj-$(CONFIG_SCSI_FUTURE_DOMAIN)+= fdomain.o
 obj-$(CONFIG_SCSI_IN2000)	+= in2000.o
 obj-$(CONFIG_SCSI_GENERIC_NCR5380) += g_NCR5380.o
-obj-$(CONFIG_SCSI_GENERIC_NCR5380_MMIO) += g_NCR5380_mmio.o
 obj-$(CONFIG_SCSI_NCR53C406A)	+= NCR53c406a.o
 obj-$(CONFIG_SCSI_NCR_D700)	+= 53c700.o NCR_D700.o
 obj-$(CONFIG_SCSI_NCR_Q720)	+= NCR_Q720_mod.o
drivers/scsi/g_NCR5380.h renamed from drivers/scsi/g_NCR5380.h.old +0 -19
@@ -64,8 +64,6 @@
 #define __STRVAL(x) #x
 #define STRVAL(x) __STRVAL(x)
 
-#ifndef CONFIG_SCSI_G_NCR5380_MEM
-
 #define NCR5380_map_config port
 #define NCR5380_map_type int
 #define NCR5380_map_name port
@@ -82,23 +80,6 @@
 #define NCR5380_read(reg) (inb(NCR5380_map_name + (reg)))
 #define NCR5380_write(reg, value) (outb((value), (NCR5380_map_name + (reg))))
 
-#else 
-/* therefore CONFIG_SCSI_G_NCR5380_MEM */
-
-#define NCR5380_map_config memory
-#define NCR5380_map_type unsigned long
-#define NCR5380_map_name base
-#define NCR5380_instance_name base
-#define NCR53C400_register_offset 0x108
-#define NCR53C400_address_adjust 0
-#define NCR53C400_mem_base 0x3880
-#define NCR53C400_host_buffer 0x3900
-#define NCR5380_region_size 0x3a00
-
-#define NCR5380_read(reg) isa_readb(NCR5380_map_name + NCR53C400_mem_base + (reg))
-#define NCR5380_write(reg, value) isa_writeb(value, NCR5380_map_name + NCR53C400_mem_base + (reg))
-#endif
-
 #define NCR5380_implementation_fields \
     NCR5380_map_type NCR5380_map_name
 
drivers/scsi/g_NCR5380.c renamed from drivers/scsi/g_NCR5380.c.old +0 -36
@@ -373,7 +373,6 @@
 			break;
 		}
 
-#ifndef CONFIG_SCSI_G_NCR5380_MEM
 		if (ports) {
 			/* wakeup sequence for the NCR53C400A and DTC3181E */
 
@@ -423,24 +422,14 @@
 				continue;
 			region_size = NCR5380_region_size;
 		}
-#else
-		if(!request_mem_region(overrides[current_override].NCR5380_map_name, NCR5380_region_size, "ncr5380"))
-			continue;
-#endif
 		instance = scsi_register(tpnt, sizeof(struct NCR5380_hostdata));
 		if (instance == NULL) {
-#ifndef CONFIG_SCSI_G_NCR5380_MEM
 			release_region(overrides[current_override].NCR5380_map_name, region_size);
-#else
-			release_mem_region(overrides[current_override].NCR5380_map_name, NCR5380_region_size);
-#endif
 			continue;
 		}
 
 		instance->NCR5380_instance_name = overrides[current_override].NCR5380_map_name;
-#ifndef CONFIG_SCSI_G_NCR5380_MEM
 		instance->n_io_port = region_size;
-#endif
 
 		NCR5380_init(instance, flags);
 
@@ -506,12 +495,7 @@
 		free_irq(instance->irq, NULL);
 	NCR5380_exit(instance);
 
-#ifndef CONFIG_SCSI_G_NCR5380_MEM
 	release_region(instance->NCR5380_instance_name, instance->n_io_port);
-#else
-	release_mem_region(instance->NCR5380_instance_name, NCR5380_region_size);
-#endif
-
 
 	return 0;
 }
@@ -578,16 +562,11 @@
 		}
 		while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY);
 
-#ifndef CONFIG_SCSI_G_NCR5380_MEM
 		{
 			int i;
 			for (i = 0; i < 128; i++)
 				dst[start + i] = NCR5380_read(C400_HOST_BUFFER);
 		}
-#else
-		/* implies CONFIG_SCSI_G_NCR5380_MEM */
-		isa_memcpy_fromio(dst + start, NCR53C400_host_buffer + NCR5380_map_name, 128);
-#endif
 		start += 128;
 		blocks--;
 	}
@@ -598,16 +577,11 @@
 			// FIXME - no timeout
 		}
 
-#ifndef CONFIG_SCSI_G_NCR5380_MEM
 		{
 			int i;	
 			for (i = 0; i < 128; i++)
 				dst[start + i] = NCR5380_read(C400_HOST_BUFFER);
 		}
-#else
-		/* implies CONFIG_SCSI_G_NCR5380_MEM */
-		isa_memcpy_fromio(dst + start, NCR53C400_host_buffer + NCR5380_map_name, 128);
-#endif
 		start += 128;
 		blocks--;
 	}
@@ -664,15 +638,10 @@
 		}
 		while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY)
 			; // FIXME - timeout
-#ifndef CONFIG_SCSI_G_NCR5380_MEM
 		{
 			for (i = 0; i < 128; i++)
 				NCR5380_write(C400_HOST_BUFFER, src[start + i]);
 		}
-#else
-		/* implies CONFIG_SCSI_G_NCR5380_MEM */
-		isa_memcpy_toio(NCR53C400_host_buffer + NCR5380_map_name, src + start, 128);
-#endif
 		start += 128;
 		blocks--;
 	}
@@ -680,15 +649,10 @@
 		while (NCR5380_read(C400_CONTROL_STATUS_REG) & CSR_HOST_BUF_NOT_RDY)
 			; // FIXME - no timeout
 
-#ifndef CONFIG_SCSI_G_NCR5380_MEM
 		{
 			for (i = 0; i < 128; i++)
 				NCR5380_write(C400_HOST_BUFFER, src[start + i]);
 		}
-#else
-		/* implies CONFIG_SCSI_G_NCR5380_MEM */
-		isa_memcpy_toio(NCR53C400_host_buffer + NCR5380_map_name, src + start, 128);
-#endif
 		start += 128;
 		blocks--;
 	}
drivers/scsi/g_NCR5380_mmio.c deleted +0 -10
@@ -1,10 +0,0 @@
-/*
- *	There is probably a nicer way to do this but this one makes
- *	pretty obvious what is happening. We rebuild the same file with
- *	different options for mmio versus pio.
- */
-
-#define SCSI_G_NCR5380_MEM
-
-#include "g_NCR5380.c"
-
#1 lore raw
Quoted 6 lines · Adrian Bunk

This patch removes the useless SCSI_GENERIC_NCR5380_MMIO.

It's useless, since SCSI_G_NCR5380_MEM != CONFIG_SCSI_G_NCR5380_MEM.

This issue exists at least since kernel 2.6.0 and since it seems noone noticed it I'd say we can safely remove it.

NACK. I know at least Alan has hardware and might want to bring it forward. A better fix would be to convert the generic ncr5380 driver to use ioread*/iowrite* so it can cover both mmio and pio in a single binary.

#2 lore raw
In reply to Adrian Bunk
Quoted 6 lines · Adrian Bunk

This patch removes the useless SCSI_GENERIC_NCR5380_MMIO.

It's useless, since SCSI_G_NCR5380_MEM != CONFIG_SCSI_G_NCR5380_MEM.

This issue exists at least since kernel 2.6.0 and since it seems noone noticed it I'd say we can safely remove it.

Its a one line bugfix so make the bugfix. There are often drivers that needed tiny fixes and it turned out that

- Vendors had it in their patch tree for years
- The one person using it fixed it and didnt bother telling l/k cos they though l/k was full of arrogant assholes who would just laugh at them
- The few users are still on 2.4 but will move to 2.6

Now when its a major rewrite to fix up some prehistoric piece of crap it makes sense to dump it if nobody uses it, when you have a one line fix required its a bit daft not to fix it.

Alan

#3 lore raw
Quoted 12 lines · Alan Cox
Quoted 6 lines · Adrian Bunk

This patch removes the useless SCSI_GENERIC_NCR5380_MMIO.

It's useless, since SCSI_G_NCR5380_MEM != CONFIG_SCSI_G_NCR5380_MEM.

This issue exists at least since kernel 2.6.0 and since it seems noone noticed it I'd say we can safely remove it.

Its a one line bugfix so make the bugfix. There are often drivers that needed tiny fixes and it turned out that

Quoted 8 lines

- Vendors had it in their patch tree for years
- The one person using it fixed it and didnt bother telling l/k cos they though l/k was full of arrogant assholes who would just laugh at them
- The few users are still on 2.4 but will move to 2.6

Now when its a major rewrite to fix up some prehistoric piece of crap it makes sense to dump it if nobody uses it, when you have a one line fix required its a bit daft not to fix it.

The part that is not a one-line fix is to move the SCSI_G_NCR5380_MEM code away from the ISA legacy API, but if this is among the patches Al wants to send later today the rest is really only a one-line fix.

Quoted 1 line

Alan

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed