linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Andrew Morton <akpm@osdl.org>
Cc: Al Viro <viro@ftp.linux.org.uk>,
	linux-kernel@vger.kernel.org, James.Bottomley@SteelEye.com,
	linux-scsi@vger.kernel.org
Subject: [4/10] remove ISA legacy functions: drivers/scsi/in2000.c
Date: Thu, 26 Jan 2006 23:49:11 +0100	[thread overview]
Message-ID: <20060126224911.GH3668@stusta.de> (raw)
In-Reply-To: <20060126223126.GD3668@stusta.de>

From: Al Viro <viro@zeniv.linux.org.uk>

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>

---

 drivers/scsi/in2000.c |   24 ++++++++++++++++++------
 1 files changed, 18 insertions(+), 6 deletions(-)

e44467683e39fd741741d07d49515e3b20e3e104
diff --git a/drivers/scsi/in2000.c b/drivers/scsi/in2000.c
--- a/drivers/scsi/in2000.c
+++ b/drivers/scsi/in2000.c
@@ -1898,6 +1898,21 @@ 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)
 {
@@ -1930,6 +1945,7 @@ static int __init in2000_detect(struct s
 
 	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;
@@ -1941,13 +1957,9 @@ static int __init in2000_detect(struct s
  * for the obvious ID strings. We look for the 2 most common ones and
  * hope that they cover all the cases...
  */
-		else if (isa_readl(bios_tab[bios] + 0x10) == 0x41564f4e || isa_readl(bios_tab[bios] + 0x30) == 0x61776c41) {
+		else if (probe_bios(bios_tab[bios], &s1, &switches)) {
 			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);
@@ -2037,7 +2049,7 @@ static int __init in2000_detect(struct s
 
 /* Older BIOS's had a 'sync on/off' switch - use its setting */
 
-		if (isa_readl(bios_tab[bios] + 0x10) == 0x41564f4e && (switches & SW_SYNC_DOS5))
+		if (s1 == 0x41564f4e && (switches & SW_SYNC_DOS5))
 			hostdata->sync_off = 0x00;	/* sync defaults to on */
 		else
 			hostdata->sync_off = 0xff;	/* sync defaults to off */


  parent reply	other threads:[~2006-01-26 22:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-26 22:31 [2.6 patch: 0/10] remove ISA legacy functions Adrian Bunk
2006-01-26 22:45 ` [1/10] remove ISA legacy functions: drivers/char/toshiba.c Adrian Bunk
2006-01-26 22:46 ` [2/10] remove ISA legacy functions: drivers/net/arcnet/ Adrian Bunk
2006-01-26 22:48 ` [3/10] remove ISA legacy functions: drivers/scsi/g_NCR5380.c Adrian Bunk
2006-01-26 22:49 ` Adrian Bunk [this message]
2006-01-26 22:51 ` [5/10] remove ISA legacy functions: drivers/net/hp-plus.c Adrian Bunk
2006-01-26 22:53 ` [6/10] remove ISA legacy functions: drivers/net/hp100.c Adrian Bunk
2006-01-26 22:54 ` [7/10] remove ISA legacy functions: drivers/net/lance.c Adrian Bunk
2006-01-26 22:56 ` [8/10] remove ISA legacy functions: remove the helpers Adrian Bunk
2006-01-26 22:57 ` [9/10] remove ISA legacy functions: remove documentation Adrian Bunk
2006-01-26 22:57 ` [10/10] remove ISA legacy functions: only 9 patches Adrian Bunk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060126224911.GH3668@stusta.de \
    --to=bunk@stusta.de \
    --cc=James.Bottomley@SteelEye.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=viro@ftp.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).