summaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-generic.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 17:36:36 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 17:36:36 +0200
commitdc9114e27acecc5a2ce2394a284a07e4e6ae5849 (patch)
treefd04888f8201bec284e05b8a150206f891bece0e /drivers/ide/ide-generic.c
parente277f91fef8a0ff7726ad33eb79c6f0d0c6229a8 (diff)
downloadop-kernel-dev-dc9114e27acecc5a2ce2394a284a07e4e6ae5849.zip
op-kernel-dev-dc9114e27acecc5a2ce2394a284a07e4e6ae5849.tar.gz
ide-generic: use ide_find_port() (take 3)
There should be no functional changes caused by this patch. v2: * Fix comment (noticed by Sergei Shtylyov). v3: * Fix no initalization of idx in some case. (Johann Felix Soden) Cc: Johann Felix Soden <johfel@users.sourceforge.net> Cc: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-generic.c')
-rw-r--r--drivers/ide/ide-generic.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c
index f3ec02e..19f63e3 100644
--- a/drivers/ide/ide-generic.c
+++ b/drivers/ide/ide-generic.c
@@ -90,11 +90,21 @@ 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) {
+ if (io_addr) {
+ /*
+ * Skip probing if the corresponding
+ * slot is already occupied.
+ */
+ hwif = ide_find_port();
+ if (hwif == NULL || hwif->index != i) {
+ idx[i] = 0xff;
+ continue;
+ }
+
memset(&hw, 0, sizeof(hw));
ide_std_init_ports(&hw, io_addr, io_addr + 0x206);
hw.irq = ide_default_irq(io_addr);
OpenPOWER on IntegriCloud