From: Rasmus Andersen <rasmus@jaquet.dk>
To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] make drivers/scsi/seagate.c use ioremap instead of isa_{read,write} (241p11)
Date: Mon, 29 Jan 2001 22:59:08 +0100 [thread overview]
Message-ID: <20010129225907.M603@jaquet.dk> (raw)
Hi.
(I have not been able to find a probable current maintainer for
this code.)
The following patch makes drivers/scsi/seagate.c use ioremap
instead of isa_{read, write}.
It applies against ac12 and 241p11.
Please comment, esp. on the size of the remappings.
--- linux-ac12-clean/drivers/scsi/seagate.c Sun Nov 12 04:01:11 2000
+++ linux-ac12/drivers/scsi/seagate.c Sun Jan 28 21:52:39 2001
@@ -256,10 +256,31 @@
MODULE_PARM(irq, "i");
#define retcode(result) (((result) << 16) | (message << 8) | status)
-#define STATUS ((u8) isa_readb(st0x_cr_sr))
-#define DATA ((u8) isa_readb(st0x_dr))
-#define WRITE_CONTROL(d) { isa_writeb((d), st0x_cr_sr); }
-#define WRITE_DATA(d) { isa_writeb((d), st0x_dr); }
+#define STATUS ((u8) read_data(st0x_cr_sr))
+#define DATA ((u8) read_data(st0x_dr))
+#define WRITE_CONTROL(d) write_data(d, st0x_cr_sr)
+#define WRITE_DATA(d) write_data(d, st0x_dr)
+
+static inline u8 read_data(unsigned long offset) {
+ void *ptr = ioremap(offset, sizeof(u8));
+ u8 ret;
+
+ if (!ptr)
+ return 1;
+ ret = readb(ptr);
+ iounmap(ptr);
+ return ret;
+}
+
+static inline int write_data(int data, unsigned long offset) {
+ void *ptr = ioremap(offset, sizeof(u8));
+
+ if (!ptr)
+ return 1;
+ writeb(data, ptr);
+ iounmap(ptr);
+ return 0;
+}
void st0x_setup (char *str, int *ints)
{
--
Regards,
Rasmus(rasmus@jaquet.dk)
I've never had major knee surgery on any other part of my body.
-Winston Bennett, University of Kentucky basketball forward
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next reply other threads:[~2001-01-29 21:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-01-29 21:59 Rasmus Andersen [this message]
2001-01-29 22:08 ` Brian Gerst
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=20010129225907.M603@jaquet.dk \
--to=rasmus@jaquet.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/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
all inboxes | Powered by JetHome®