Commit 90b33c54 authored by Randy Dunlap's avatar Randy Dunlap Committed by James Bottomley

[PATCH] fix check_region usage in eata_pio

Based on "eata_generic.h", this SCSI controller has 9 bytes of IO
space, not 8, so update request_region(), release_region(), and
n_io_port to use 9 instead of 8.

diffstat:=
 drivers/scsi/eata_pio.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent e8af210c
...@@ -593,7 +593,7 @@ static int get_pio_conf_PIO(u32 base, struct get_conf *buf) ...@@ -593,7 +593,7 @@ static int get_pio_conf_PIO(u32 base, struct get_conf *buf)
int z; int z;
unsigned short *p; unsigned short *p;
if (!request_region(base, 8, "eata_pio")) if (!request_region(base, 9, "eata_pio"))
return 0; return 0;
memset(buf, 0, sizeof(struct get_conf)); memset(buf, 0, sizeof(struct get_conf));
...@@ -641,7 +641,7 @@ static int get_pio_conf_PIO(u32 base, struct get_conf *buf) ...@@ -641,7 +641,7 @@ static int get_pio_conf_PIO(u32 base, struct get_conf *buf)
return 1; return 1;
fail: fail:
release_region(base, 8); release_region(base, 9);
return 0; return 0;
} }
...@@ -784,7 +784,7 @@ static int register_pio_HBA(long base, struct get_conf *gc, Scsi_Host_Template * ...@@ -784,7 +784,7 @@ static int register_pio_HBA(long base, struct get_conf *gc, Scsi_Host_Template *
sh->unique_id = base; sh->unique_id = base;
sh->base = base; sh->base = base;
sh->io_port = base; sh->io_port = base;
sh->n_io_port = 8; sh->n_io_port = 9;
sh->irq = gc->IRQ; sh->irq = gc->IRQ;
sh->dma_channel = PIO; sh->dma_channel = PIO;
sh->this_id = gc->scsi_id[3]; sh->this_id = gc->scsi_id[3];
...@@ -825,7 +825,7 @@ static void find_pio_ISA(struct get_conf *buf, Scsi_Host_Template * tpnt) ...@@ -825,7 +825,7 @@ static void find_pio_ISA(struct get_conf *buf, Scsi_Host_Template * tpnt)
if (!get_pio_conf_PIO(ISAbases[i], buf)) if (!get_pio_conf_PIO(ISAbases[i], buf))
continue; continue;
if (!register_pio_HBA(ISAbases[i], buf, tpnt)) if (!register_pio_HBA(ISAbases[i], buf, tpnt))
release_region(ISAbases[i], 8); release_region(ISAbases[i], 9);
else else
ISAbases[i] = 0; ISAbases[i] = 0;
} }
...@@ -857,10 +857,10 @@ static void find_pio_EISA(struct get_conf *buf, Scsi_Host_Template * tpnt) ...@@ -857,10 +857,10 @@ static void find_pio_EISA(struct get_conf *buf, Scsi_Host_Template * tpnt)
DBG(DBG_PROBE && DBG_EISA, print_pio_config(buf)); DBG(DBG_PROBE && DBG_EISA, print_pio_config(buf));
if (buf->IRQ) { if (buf->IRQ) {
if (!register_pio_HBA(base, buf, tpnt)) if (!register_pio_HBA(base, buf, tpnt))
release_region(base, 8); release_region(base, 9);
} else { } else {
printk(KERN_NOTICE "eata_dma: No valid IRQ. HBA " "removed from list\n"); printk(KERN_NOTICE "eata_dma: No valid IRQ. HBA " "removed from list\n");
release_region(base, 8); release_region(base, 9);
} }
} }
/* Nothing found here so we take it from the list */ /* Nothing found here so we take it from the list */
...@@ -900,7 +900,7 @@ static void find_pio_PCI(struct get_conf *buf, Scsi_Host_Template * tpnt) ...@@ -900,7 +900,7 @@ static void find_pio_PCI(struct get_conf *buf, Scsi_Host_Template * tpnt)
/* We didn't find it in the primary search */ /* We didn't find it in the primary search */
if (get_pio_conf_PIO(base, buf)) { if (get_pio_conf_PIO(base, buf)) {
if (buf->FORCADR) { /* If the address is forced */ if (buf->FORCADR) { /* If the address is forced */
release_region(base, 8); release_region(base, 9);
continue; /* we'll find it later */ continue; /* we'll find it later */
} }
...@@ -910,7 +910,7 @@ static void find_pio_PCI(struct get_conf *buf, Scsi_Host_Template * tpnt) ...@@ -910,7 +910,7 @@ static void find_pio_PCI(struct get_conf *buf, Scsi_Host_Template * tpnt)
*/ */
if (!register_pio_HBA(base, buf, tpnt)) { if (!register_pio_HBA(base, buf, tpnt)) {
release_region(base, 8); release_region(base, 9);
continue; continue;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment