All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe De Muyter <phdm@macqel.be>
To: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, hancockrwd@gmail.com,
	abelay@mit.edu, lenb@kernel.org, stable@kernel.org
Subject: [PATCH] floppy: release only the ports we actually requested
Date: Fri, 6 Feb 2009 09:55:01 +0100	[thread overview]
Message-ID: <20090206085501.GA18125@frolo.macqel> (raw)
In-Reply-To: <200902051643.32591.bjorn.helgaas@hp.com>

Bjorn, Andrew,

--

With the last floppy patch, the floppy driver requests only the ports that
it really uses, but the code contains yet places where it releases those
unrequested ports.  I don't know if it is harmfull, but I think it is cleaner
that the parameters of the release_region calls match the request_region ones.

Signed-off-by: Philippe De Muyter <phdm@macqel.be>

--- a/drivers/block/floppy.c	2009-02-06 08:56:33.000000000 +0100
+++ b/drivers/block/floppy.c	2009-02-06 09:05:55.000000000 +0100
@@ -4274,7 +4274,8 @@ static int __init floppy_init(void)
 		FDCS->rawcmd = 2;
 		if (user_reset_fdc(-1, FD_RESET_ALWAYS, 0)) {
 			/* free ioports reserved by floppy_grab_irq_and_dma() */
-			release_region(FDCS->address + 2, 4);
+			release_region(FDCS->address + 2, 1);
+			release_region(FDCS->address + 4, 2);
 			release_region(FDCS->address + 7, 1);
 			FDCS->address = -1;
 			FDCS->version = FDC_NONE;
@@ -4284,7 +4285,8 @@ static int __init floppy_init(void)
 		FDCS->version = get_fdc_version();
 		if (FDCS->version == FDC_NONE) {
 			/* free ioports reserved by floppy_grab_irq_and_dma() */
-			release_region(FDCS->address + 2, 4);
+			release_region(FDCS->address + 2, 1);
+			release_region(FDCS->address + 4, 2);
 			release_region(FDCS->address + 7, 1);
 			FDCS->address = -1;
 			continue;
@@ -4510,7 +4512,8 @@ static void floppy_release_irq_and_dma(v
 	old_fdc = fdc;
 	for (fdc = 0; fdc < N_FDC; fdc++)
 		if (FDCS->address != -1) {
-			release_region(FDCS->address + 2, 4);
+			release_region(FDCS->address + 2, 1);
+			release_region(FDCS->address + 4, 2);
 			release_region(FDCS->address + 7, 1);
 		}
 	fdc = old_fdc;

  reply	other threads:[~2009-02-06  8:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-05 17:48 [PATCH] floppy: request only the ports we actually use Bjorn Helgaas
2009-02-05 17:55 ` Bjorn Helgaas
2009-02-05 22:29   ` Andrew Morton
2009-02-05 23:43     ` Bjorn Helgaas
2009-02-06  8:55       ` Philippe De Muyter [this message]
2009-02-06 16:20         ` [PATCH] floppy: release only the ports we actually requested Bjorn Helgaas
2009-02-06 17:57           ` Bjorn Helgaas
2009-02-09  9:15             ` Philippe De Muyter
2009-02-10 17:16               ` Bjorn Helgaas
2009-02-13  8:55 ` [PATCH] floppy: request and release only the ports we actually use Philippe De Muyter
2009-02-13 16:37   ` Bjorn Helgaas

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=20090206085501.GA18125@frolo.macqel \
    --to=phdm@macqel.be \
    --cc=abelay@mit.edu \
    --cc=akpm@linux-foundation.org \
    --cc=bjorn.helgaas@hp.com \
    --cc=hancockrwd@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.