Skip to content

Commit

Permalink
rapide: fix rapide_probe() return value
Browse files Browse the repository at this point in the history
Return -ENOENT on ide_find_port() failure.

While at it:

- Cleanup rapide_probe() a bit.

Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Jul 16, 2008
1 parent ff23712 commit 47bc7e7
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions drivers/ide/arm/rapide.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,26 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
goto release;
}

hwif = ide_find_port();
if (hwif) {
memset(&hw, 0, sizeof(hw));
rapide_setup_ports(&hw, base, base + 0x818, 1 << 6, ec->irq);
hw.chipset = ide_generic;
hw.dev = &ec->dev;
memset(&hw, 0, sizeof(hw));
rapide_setup_ports(&hw, base, base + 0x818, 1 << 6, ec->irq);
hw.chipset = ide_generic;
hw.dev = &ec->dev;

ide_init_port_hw(hwif, &hw);
hwif = ide_find_port();
if (hwif == NULL) {
ret = -ENOENT;
goto release;
}

default_hwif_mmiops(hwif);
ide_init_port_hw(hwif, &hw);
default_hwif_mmiops(hwif);

idx[0] = hwif->index;
idx[0] = hwif->index;

ide_device_add(idx, &rapide_port_info);
ide_device_add(idx, &rapide_port_info);

ecard_set_drvdata(ec, hwif);
goto out;
}
ecard_set_drvdata(ec, hwif);
goto out;

release:
ecard_release_resources(ec);
Expand Down

0 comments on commit 47bc7e7

Please sign in to comment.