public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Domen Puncer <root@coderock.org>
To: linux-kernel@vger.kernel.org
Subject: [RFC] check_region removal from 3c509.c
Date: Thu, 10 Jul 2003 15:54:52 +0200	[thread overview]
Message-ID: <200307101554.52458.root@coderock.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 174 bytes --]

Hi.

Replaced check_region() with request_region(), removed 2 #ifdefs.

This is first time i'm posting a patch, so please comment if something could 
be done better.


	Domen

[-- Attachment #2: 3c509.c-check_region-2.patch --]
[-- Type: text/x-diff, Size: 1433 bytes --]

--- linux-2.5.74/drivers/net/3c509.c-orig	2003-07-10 12:55:08.000000000 +0200
+++ linux-2.5.74/drivers/net/3c509.c	2003-07-10 15:01:41.000000000 +0200
@@ -370,9 +370,7 @@
 #if defined(__ISAPNP__) && !defined(CONFIG_X86_PC9800)
 	static int pnp_cards;
 	struct pnp_dev *idev = NULL;
-#endif /* __ISAPNP__ */
 
-#if defined(__ISAPNP__) && !defined(CONFIG_X86_PC9800)
 	if (nopnp == 1)
 		goto no_pnp;
 
@@ -428,12 +426,15 @@
 #else
 	/* Select an open I/O location at 0x1*0 to do contention select. */
 	for ( ; id_port < 0x200; id_port += 0x10) {
-		if (check_region(id_port, 1))
+		if (!request_region(id_port, 1, "3c509"))
 			continue;
 		outb(0x00, id_port);
 		outb(0xff, id_port);
-		if (inb(id_port) & 0x01)
+		if (inb(id_port) & 0x01){
+			release_region(id_port, 1);
 			break;
+		} else
+			release_region(id_port, 1);
 	}
 	if (id_port >= 0x200) {
 		/* Rare -- do we really need a warning? */
@@ -496,19 +497,17 @@
 	{
 		unsigned int iobase = id_read_eeprom(8);
 		if_port = iobase >> 14;
+		irq = id_read_eeprom(9) >> 12;
 #ifdef CONFIG_X86_PC9800
 		ioaddr = 0x40d0 + ((iobase & 0x1f) << 8);
+		if (irq == 7)
+			irq = 6;
+		else if (irq == 15)
+			irq = 13;
 #else
 		ioaddr = 0x200 + ((iobase & 0x1f) << 4);
 #endif
 	}
-	irq = id_read_eeprom(9) >> 12;
-#ifdef CONFIG_X86_PC9800
-	if (irq == 7)
-		irq = 6;
-	else if (irq == 15)
-		irq = 13;
-#endif
 
 	dev = alloc_etherdev(sizeof (struct el3_private));
 	if (!dev)

                 reply	other threads:[~2003-07-10 13:40 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=200307101554.52458.root@coderock.org \
    --to=root@coderock.org \
    --cc=linux-kernel@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