Commit 22bc685f4b93f4a0ce28e5829eaf754cb4f7c040
Committed by
Linus Torvalds
1 parent
c818cb6406
Exists in
master
and in
4 other branches
[PATCH] remove ISA legacy functions: drivers/scsi/in2000.c
switched to ioremap(), cleaned the probing up a bit. 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>
Showing 1 changed file with 18 additions and 6 deletions Side-by-side Diff
drivers/scsi/in2000.c
| ... | ... | @@ -1898,6 +1898,21 @@ |
| 1898 | 1898 | 10 |
| 1899 | 1899 | }; |
| 1900 | 1900 | |
| 1901 | +static int probe_bios(u32 addr, u32 *s1, uchar *switches) | |
| 1902 | +{ | |
| 1903 | + void __iomem *p = ioremap(addr, 0x34); | |
| 1904 | + if (!p) | |
| 1905 | + return 0; | |
| 1906 | + *s1 = readl(p + 0x10); | |
| 1907 | + if (*s1 == 0x41564f4e || readl(p + 0x30) == 0x61776c41) { | |
| 1908 | + /* Read the switch image that's mapped into EPROM space */ | |
| 1909 | + *switches = ~readb(p + 0x20); | |
| 1910 | + iounmap(p); | |
| 1911 | + return 1; | |
| 1912 | + } | |
| 1913 | + iounmap(p); | |
| 1914 | + return 0; | |
| 1915 | +} | |
| 1901 | 1916 | |
| 1902 | 1917 | static int __init in2000_detect(struct scsi_host_template * tpnt) |
| 1903 | 1918 | { |
| ... | ... | @@ -1930,6 +1945,7 @@ |
| 1930 | 1945 | |
| 1931 | 1946 | detect_count = 0; |
| 1932 | 1947 | for (bios = 0; bios_tab[bios]; bios++) { |
| 1948 | + u32 s1 = 0; | |
| 1933 | 1949 | if (check_setup_args("ioport", &val, buf)) { |
| 1934 | 1950 | base = val; |
| 1935 | 1951 | switches = ~inb(base + IO_SWITCHES) & 0xff; |
| 1936 | 1952 | |
| ... | ... | @@ -1941,13 +1957,9 @@ |
| 1941 | 1957 | * for the obvious ID strings. We look for the 2 most common ones and |
| 1942 | 1958 | * hope that they cover all the cases... |
| 1943 | 1959 | */ |
| 1944 | - else if (isa_readl(bios_tab[bios] + 0x10) == 0x41564f4e || isa_readl(bios_tab[bios] + 0x30) == 0x61776c41) { | |
| 1960 | + else if (probe_bios(bios_tab[bios], &s1, &switches)) { | |
| 1945 | 1961 | printk("Found IN2000 BIOS at 0x%x ", (unsigned int) bios_tab[bios]); |
| 1946 | 1962 | |
| 1947 | -/* Read the switch image that's mapped into EPROM space */ | |
| 1948 | - | |
| 1949 | - switches = ~((isa_readb(bios_tab[bios] + 0x20) & 0xff)); | |
| 1950 | - | |
| 1951 | 1963 | /* Find out where the IO space is */ |
| 1952 | 1964 | |
| 1953 | 1965 | x = switches & (SW_ADDR0 | SW_ADDR1); |
| ... | ... | @@ -2037,7 +2049,7 @@ |
| 2037 | 2049 | |
| 2038 | 2050 | /* Older BIOS's had a 'sync on/off' switch - use its setting */ |
| 2039 | 2051 | |
| 2040 | - if (isa_readl(bios_tab[bios] + 0x10) == 0x41564f4e && (switches & SW_SYNC_DOS5)) | |
| 2052 | + if (s1 == 0x41564f4e && (switches & SW_SYNC_DOS5)) | |
| 2041 | 2053 | hostdata->sync_off = 0x00; /* sync defaults to on */ |
| 2042 | 2054 | else |
| 2043 | 2055 | hostdata->sync_off = 0xff; /* sync defaults to off */ |