X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fscsi%2Fin2000.c;h=34daa3e068deb232b76580588049fcf9b113a9f6;hb=987b0145d94eecf292d8b301228356f44611ab7c;hp=9c519876f8a01d94157e0dc60a65e8096fd84371;hpb=f7ed79d23a47594e7834d66a8f14449796d4f3e6;p=linux-2.6.git diff --git a/drivers/scsi/in2000.c b/drivers/scsi/in2000.c index 9c519876f..34daa3e06 100644 --- a/drivers/scsi/in2000.c +++ b/drivers/scsi/in2000.c @@ -1898,21 +1898,6 @@ static int int_tab[] in2000__INITDATA = { 10 }; -static int probe_bios(u32 addr, u32 *s1, uchar *switches) -{ - void __iomem *p = ioremap(addr, 0x34); - if (!p) - return 0; - *s1 = readl(p + 0x10); - if (*s1 == 0x41564f4e || readl(p + 0x30) == 0x61776c41) { - /* Read the switch image that's mapped into EPROM space */ - *switches = ~readb(p + 0x20); - iounmap(p); - return 1; - } - iounmap(p); - return 0; -} static int __init in2000_detect(struct scsi_host_template * tpnt) { @@ -1945,7 +1930,6 @@ static int __init in2000_detect(struct scsi_host_template * tpnt) detect_count = 0; for (bios = 0; bios_tab[bios]; bios++) { - u32 s1 = 0; if (check_setup_args("ioport", &val, buf)) { base = val; switches = ~inb(base + IO_SWITCHES) & 0xff; @@ -1957,9 +1941,13 @@ static int __init in2000_detect(struct scsi_host_template * tpnt) * for the obvious ID strings. We look for the 2 most common ones and * hope that they cover all the cases... */ - else if (probe_bios(bios_tab[bios], &s1, &switches)) { + else if (isa_readl(bios_tab[bios] + 0x10) == 0x41564f4e || isa_readl(bios_tab[bios] + 0x30) == 0x61776c41) { printk("Found IN2000 BIOS at 0x%x ", (unsigned int) bios_tab[bios]); +/* Read the switch image that's mapped into EPROM space */ + + switches = ~((isa_readb(bios_tab[bios] + 0x20) & 0xff)); + /* Find out where the IO space is */ x = switches & (SW_ADDR0 | SW_ADDR1); @@ -2049,7 +2037,7 @@ static int __init in2000_detect(struct scsi_host_template * tpnt) /* Older BIOS's had a 'sync on/off' switch - use its setting */ - if (s1 == 0x41564f4e && (switches & SW_SYNC_DOS5)) + if (isa_readl(bios_tab[bios] + 0x10) == 0x41564f4e && (switches & SW_SYNC_DOS5)) hostdata->sync_off = 0x00; /* sync defaults to on */ else hostdata->sync_off = 0xff; /* sync defaults to off */