LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 4/5] ide-generic: use ide_find_port()
Date: Sun, 17 Feb 2008 19:51:33 +0100	[thread overview]
Message-ID: <20080217185133.16210.73293.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20080217185105.16210.26582.sendpatchset@localhost.localdomain>

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/ide-generic.c |   17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

Index: b/drivers/ide/ide-generic.c
===================================================================
--- a/drivers/ide/ide-generic.c
+++ b/drivers/ide/ide-generic.c
@@ -90,18 +90,27 @@ static int __init ide_generic_init(void)
 	int i;
 
 	for (i = 0; i < MAX_HWIFS; i++) {
-		ide_hwif_t *hwif = &ide_hwifs[i];
+		ide_hwif_t *hwif;
 		unsigned long io_addr = ide_default_io_base(i);
 		hw_regs_t hw;
 
-		if (hwif->chipset == ide_unknown && io_addr) {
-			u8 oldnoprobe = hwif->noprobe;
+		if (io_addr) {
+			u8 oldnoprobe;
+
+			/*
+			 * Skip probing if the corresponding
+			 * slot entry is already occupied.
+			 */
+			hwif = ide_find_port();
+			if (hwif == NULL || hwif->index != i)
+				continue;
 
 			memset(&hw, 0, sizeof(hw));
 			ide_std_init_ports(&hw, io_addr, io_addr + 0x206);
 			hw.irq = ide_default_irq(io_addr);
-			ide_init_port_hw(hwif, &hw);
 
+			oldnoprobe = hwif->noprobe;
+			ide_init_port_hw(hwif, &hw);
 			hwif->noprobe = oldnoprobe;
 
 			idx[i] = i;

  parent reply	other threads:[~2008-02-17 18:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-17 18:51 [PATCH 1/5] ide: remove PIO "downgrade" quirk Bartlomiej Zolnierkiewicz
2008-02-17 18:51 ` [PATCH 2/5] ide: merge ide_match_hwif() and ide_find_port() Bartlomiej Zolnierkiewicz
2008-02-17 18:51 ` [PATCH 3/5] ide: use ide_find_port() in legacy VLB host drivers Bartlomiej Zolnierkiewicz
2008-02-17 18:51 ` Bartlomiej Zolnierkiewicz [this message]
2008-02-19 12:33   ` [PATCH 4/5] ide-generic: use ide_find_port() Sergei Shtylyov
2008-02-19 21:20     ` Bartlomiej Zolnierkiewicz
2008-02-17 18:51 ` [PATCH 5/5] ide: unexport ide_hwifs[] Bartlomiej Zolnierkiewicz
2008-02-18 16:06 ` [PATCH 1/5] ide: remove PIO "downgrade" quirk Sergei Shtylyov
2008-02-18 17:02   ` Bartlomiej Zolnierkiewicz

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=20080217185133.16210.73293.sendpatchset@localhost.localdomain \
    --to=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH 4/5] ide-generic: use ide_find_port()' \
    /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

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).