[PATCH] remove ISA legacy functions: drivers/scsi/g_NCR5380.c
switched CONFIG_SCSI_G_NCR5380_MEM code in g_NCR5380 to ioremap(); massaged g_NCR5380.h accordingly. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
ef5a4c8b04
commit
c818cb6406
|
@ -127,7 +127,7 @@ static int ncr_53c400a = NCR_NOT_SET;
|
||||||
static int dtc_3181e = NCR_NOT_SET;
|
static int dtc_3181e = NCR_NOT_SET;
|
||||||
|
|
||||||
static struct override {
|
static struct override {
|
||||||
NCR5380_implementation_fields;
|
NCR5380_map_type NCR5380_map_name;
|
||||||
int irq;
|
int irq;
|
||||||
int dma;
|
int dma;
|
||||||
int board; /* Use NCR53c400, Ricoh, etc. extensions ? */
|
int board; /* Use NCR53c400, Ricoh, etc. extensions ? */
|
||||||
|
@ -299,6 +299,10 @@ int __init generic_NCR5380_detect(struct scsi_host_template * tpnt)
|
||||||
};
|
};
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
struct Scsi_Host *instance;
|
struct Scsi_Host *instance;
|
||||||
|
#ifdef CONFIG_SCSI_G_NCR5380_MEM
|
||||||
|
unsigned long base;
|
||||||
|
void __iomem *iomem;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (ncr_irq != NCR_NOT_SET)
|
if (ncr_irq != NCR_NOT_SET)
|
||||||
overrides[0].irq = ncr_irq;
|
overrides[0].irq = ncr_irq;
|
||||||
|
@ -424,15 +428,22 @@ int __init generic_NCR5380_detect(struct scsi_host_template * tpnt)
|
||||||
region_size = NCR5380_region_size;
|
region_size = NCR5380_region_size;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if(!request_mem_region(overrides[current_override].NCR5380_map_name, NCR5380_region_size, "ncr5380"))
|
base = overrides[current_override].NCR5380_map_name;
|
||||||
|
if (!request_mem_region(base, NCR5380_region_size, "ncr5380"))
|
||||||
continue;
|
continue;
|
||||||
|
iomem = ioremap(base, NCR5380_region_size);
|
||||||
|
if (!iomem) {
|
||||||
|
release_mem_region(base, NCR5380_region_size);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
instance = scsi_register(tpnt, sizeof(struct NCR5380_hostdata));
|
instance = scsi_register(tpnt, sizeof(struct NCR5380_hostdata));
|
||||||
if (instance == NULL) {
|
if (instance == NULL) {
|
||||||
#ifndef CONFIG_SCSI_G_NCR5380_MEM
|
#ifndef CONFIG_SCSI_G_NCR5380_MEM
|
||||||
release_region(overrides[current_override].NCR5380_map_name, region_size);
|
release_region(overrides[current_override].NCR5380_map_name, region_size);
|
||||||
#else
|
#else
|
||||||
release_mem_region(overrides[current_override].NCR5380_map_name, NCR5380_region_size);
|
iounmap(iomem);
|
||||||
|
release_mem_region(base, NCR5380_region_size);
|
||||||
#endif
|
#endif
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -440,6 +451,8 @@ int __init generic_NCR5380_detect(struct scsi_host_template * tpnt)
|
||||||
instance->NCR5380_instance_name = overrides[current_override].NCR5380_map_name;
|
instance->NCR5380_instance_name = overrides[current_override].NCR5380_map_name;
|
||||||
#ifndef CONFIG_SCSI_G_NCR5380_MEM
|
#ifndef CONFIG_SCSI_G_NCR5380_MEM
|
||||||
instance->n_io_port = region_size;
|
instance->n_io_port = region_size;
|
||||||
|
#else
|
||||||
|
((struct NCR5380_hostdata *)instance->hostdata).iomem = iomem;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
NCR5380_init(instance, flags);
|
NCR5380_init(instance, flags);
|
||||||
|
@ -509,6 +522,7 @@ int generic_NCR5380_release_resources(struct Scsi_Host *instance)
|
||||||
#ifndef CONFIG_SCSI_G_NCR5380_MEM
|
#ifndef CONFIG_SCSI_G_NCR5380_MEM
|
||||||
release_region(instance->NCR5380_instance_name, instance->n_io_port);
|
release_region(instance->NCR5380_instance_name, instance->n_io_port);
|
||||||
#else
|
#else
|
||||||
|
iounmap(((struct NCR5380_hostdata *)instance->hostdata).iomem);
|
||||||
release_mem_region(instance->NCR5380_instance_name, NCR5380_region_size);
|
release_mem_region(instance->NCR5380_instance_name, NCR5380_region_size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -586,7 +600,7 @@ static inline int NCR5380_pread(struct Scsi_Host *instance, unsigned char *dst,
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
/* implies CONFIG_SCSI_G_NCR5380_MEM */
|
/* implies CONFIG_SCSI_G_NCR5380_MEM */
|
||||||
isa_memcpy_fromio(dst + start, NCR53C400_host_buffer + NCR5380_map_name, 128);
|
memcpy_fromio(dst + start, iomem + NCR53C400_host_buffer, 128);
|
||||||
#endif
|
#endif
|
||||||
start += 128;
|
start += 128;
|
||||||
blocks--;
|
blocks--;
|
||||||
|
@ -606,7 +620,7 @@ static inline int NCR5380_pread(struct Scsi_Host *instance, unsigned char *dst,
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
/* implies CONFIG_SCSI_G_NCR5380_MEM */
|
/* implies CONFIG_SCSI_G_NCR5380_MEM */
|
||||||
isa_memcpy_fromio(dst + start, NCR53C400_host_buffer + NCR5380_map_name, 128);
|
memcpy_fromio(dst + start, iomem + NCR53C400_host_buffer, 128);
|
||||||
#endif
|
#endif
|
||||||
start += 128;
|
start += 128;
|
||||||
blocks--;
|
blocks--;
|
||||||
|
@ -671,7 +685,7 @@ static inline int NCR5380_pwrite(struct Scsi_Host *instance, unsigned char *src,
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
/* implies CONFIG_SCSI_G_NCR5380_MEM */
|
/* implies CONFIG_SCSI_G_NCR5380_MEM */
|
||||||
isa_memcpy_toio(NCR53C400_host_buffer + NCR5380_map_name, src + start, 128);
|
memcpy_toio(iomem + NCR53C400_host_buffer, src + start, 128);
|
||||||
#endif
|
#endif
|
||||||
start += 128;
|
start += 128;
|
||||||
blocks--;
|
blocks--;
|
||||||
|
@ -687,7 +701,7 @@ static inline int NCR5380_pwrite(struct Scsi_Host *instance, unsigned char *src,
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
/* implies CONFIG_SCSI_G_NCR5380_MEM */
|
/* implies CONFIG_SCSI_G_NCR5380_MEM */
|
||||||
isa_memcpy_toio(NCR53C400_host_buffer + NCR5380_map_name, src + start, 128);
|
memcpy_toio(iomem + NCR53C400_host_buffer, src + start, 128);
|
||||||
#endif
|
#endif
|
||||||
start += 128;
|
start += 128;
|
||||||
blocks--;
|
blocks--;
|
||||||
|
|
|
@ -82,6 +82,15 @@ static const char* generic_NCR5380_info(struct Scsi_Host *);
|
||||||
#define NCR5380_read(reg) (inb(NCR5380_map_name + (reg)))
|
#define NCR5380_read(reg) (inb(NCR5380_map_name + (reg)))
|
||||||
#define NCR5380_write(reg, value) (outb((value), (NCR5380_map_name + (reg))))
|
#define NCR5380_write(reg, value) (outb((value), (NCR5380_map_name + (reg))))
|
||||||
|
|
||||||
|
#define NCR5380_implementation_fields \
|
||||||
|
NCR5380_map_type NCR5380_map_name
|
||||||
|
|
||||||
|
#define NCR5380_local_declare() \
|
||||||
|
register NCR5380_implementation_fields
|
||||||
|
|
||||||
|
#define NCR5380_setup(instance) \
|
||||||
|
NCR5380_map_name = (NCR5380_map_type)((instance)->NCR5380_instance_name)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
/* therefore CONFIG_SCSI_G_NCR5380_MEM */
|
/* therefore CONFIG_SCSI_G_NCR5380_MEM */
|
||||||
|
|
||||||
|
@ -95,18 +104,20 @@ static const char* generic_NCR5380_info(struct Scsi_Host *);
|
||||||
#define NCR53C400_host_buffer 0x3900
|
#define NCR53C400_host_buffer 0x3900
|
||||||
#define NCR5380_region_size 0x3a00
|
#define NCR5380_region_size 0x3a00
|
||||||
|
|
||||||
#define NCR5380_read(reg) isa_readb(NCR5380_map_name + NCR53C400_mem_base + (reg))
|
#define NCR5380_read(reg) readb(iomem + NCR53C400_mem_base + (reg))
|
||||||
#define NCR5380_write(reg, value) isa_writeb(value, NCR5380_map_name + NCR53C400_mem_base + (reg))
|
#define NCR5380_write(reg, value) writeb(value, iomem + NCR53C400_mem_base + (reg))
|
||||||
#endif
|
|
||||||
|
|
||||||
#define NCR5380_implementation_fields \
|
#define NCR5380_implementation_fields \
|
||||||
NCR5380_map_type NCR5380_map_name
|
NCR5380_map_type NCR5380_map_name; \
|
||||||
|
void __iomem *iomem;
|
||||||
|
|
||||||
#define NCR5380_local_declare() \
|
#define NCR5380_local_declare() \
|
||||||
register NCR5380_implementation_fields
|
register void __iomem *iomem
|
||||||
|
|
||||||
#define NCR5380_setup(instance) \
|
#define NCR5380_setup(instance) \
|
||||||
NCR5380_map_name = (NCR5380_map_type)((instance)->NCR5380_instance_name)
|
iomem = (((struct NCR5380_hostdata *)(instance)->hostdata).iomem)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#define NCR5380_intr generic_NCR5380_intr
|
#define NCR5380_intr generic_NCR5380_intr
|
||||||
#define NCR5380_queue_command generic_NCR5380_queue_command
|
#define NCR5380_queue_command generic_NCR5380_queue_command
|
||||||
|
|
Loading…
Reference in New Issue