From: Rasmus Andersen <rasmus@jaquet.dk>
To: zaga@fly.srk.fer.hr
Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: [PATCH] drivers/scsi/wd7000.c: check_region -> request_region (241p9)
Date: Tue, 23 Jan 2001 23:52:15 +0100 [thread overview]
Message-ID: <20010123235215.E9514@jaquet.dk> (raw)
Hi.
The following patch makes drivers/scsi/wd7000.c use request_region
instead of check_region+request_region. It also drops a panic() and
changes error paths to be forward gotos (in part necessary by the
request_region change).
It applies cleanly against ac10 and 241p9.
Comments?
--- linux-ac10-clean/drivers/scsi/wd7000.c Sun Nov 12 04:01:11 2000
+++ linux-ac10/drivers/scsi/wd7000.c Mon Jan 22 21:05:10 2001
@@ -863,7 +863,7 @@
*/
if (freescbs < needed) {
busy = 0;
- panic ("wd7000: can't get enough free SCBs.\n");
+ printk (KERN_ERR "wd7000: can't get enough free SCBs.\n");
restore_flags (flags);
return (NULL);
}
@@ -1593,7 +1593,7 @@
printk ("wd7000_detect: check IO 0x%x region...\n", iobase);
#endif
- if (!check_region (iobase, 4)) {
+ if (request_region (iobase, 4, "wd7000")) {
#ifdef WD7000_DEBUG
printk ("wd7000_detect: ASC reset (IO 0x%x) ...", iobase);
@@ -1609,12 +1609,12 @@
#ifdef WD7000_DEBUG
{
printk ("failed!\n");
- continue;
+ goto err_release;
}
- else
+ else
printk ("ok!\n");
#else
- continue;
+ goto err_release;
#endif
if (inb (iobase + ASC_INTR_STAT) == 1) {
@@ -1627,7 +1627,8 @@
*/
sh = scsi_register (tpnt, sizeof (Adapter));
if(sh==NULL)
- continue;
+ goto err_release;
+
host = (Adapter *) sh->hostdata;
#ifdef WD7000_DEBUG
@@ -1650,11 +1651,8 @@
host->iobase, host->irq, host->dma);
#endif
- if (!wd7000_init (host)) { /* Initialization failed */
- scsi_unregister (sh);
-
- continue;
- }
+ if (!wd7000_init (host)) /* Initialization failed */
+ goto err_unregister;
/*
* OK from here - we'll use this adapter/configuration.
@@ -1662,11 +1660,6 @@
wd7000_revision (host); /* important for scatter/gather */
/*
- * Register our ports.
- */
- request_region (host->iobase, 4, "wd7000");
-
- /*
* For boards before rev 6.0, scatter/gather isn't supported.
*/
if (host->rev1 < 6)
@@ -1690,6 +1683,13 @@
else
printk ("wd7000_detect: IO 0x%x region already allocated!\n", iobase);
#endif
+
+ continue;
+
+ err_unregister:
+ scsi_unregister (sh);
+ err_release:
+ release_region(iobase, 4);
}
--
Regards,
Rasmus(rasmus@jaquet.dk)
First snow, then silence.
This thousand dollar screen dies
so beautifully. --- Error messages in haiku
-
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/
reply other threads:[~2001-01-23 22:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20010123235215.E9514@jaquet.dk \
--to=rasmus@jaquet.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=zaga@fly.srk.fer.hr \
/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).