mirror of
https://github.com/adulau/aha.git
synced 2025-01-04 07:03:38 +00:00
rapide: fix rapide_probe() return value
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>
This commit is contained in:
parent
ff23712e79
commit
47bc7e7425
1 changed files with 18 additions and 16 deletions
|
@ -48,15 +48,18 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
|
||||||
goto release;
|
goto release;
|
||||||
}
|
}
|
||||||
|
|
||||||
hwif = ide_find_port();
|
|
||||||
if (hwif) {
|
|
||||||
memset(&hw, 0, sizeof(hw));
|
memset(&hw, 0, sizeof(hw));
|
||||||
rapide_setup_ports(&hw, base, base + 0x818, 1 << 6, ec->irq);
|
rapide_setup_ports(&hw, base, base + 0x818, 1 << 6, ec->irq);
|
||||||
hw.chipset = ide_generic;
|
hw.chipset = ide_generic;
|
||||||
hw.dev = &ec->dev;
|
hw.dev = &ec->dev;
|
||||||
|
|
||||||
ide_init_port_hw(hwif, &hw);
|
hwif = ide_find_port();
|
||||||
|
if (hwif == NULL) {
|
||||||
|
ret = -ENOENT;
|
||||||
|
goto release;
|
||||||
|
}
|
||||||
|
|
||||||
|
ide_init_port_hw(hwif, &hw);
|
||||||
default_hwif_mmiops(hwif);
|
default_hwif_mmiops(hwif);
|
||||||
|
|
||||||
idx[0] = hwif->index;
|
idx[0] = hwif->index;
|
||||||
|
@ -65,7 +68,6 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
|
||||||
|
|
||||||
ecard_set_drvdata(ec, hwif);
|
ecard_set_drvdata(ec, hwif);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
ecard_release_resources(ec);
|
ecard_release_resources(ec);
|
||||||
|
|
Loading…
Reference in a new issue