diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-16 14:33:44 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-16 14:33:44 -0400 |
commit | 47bc7e7425d198ad1f8c4597b0bf28619fcce0fd (patch) | |
tree | 4cb8709b02083fa72124231142286c4c3d08e183 | |
parent | ff23712e791fd80f3b088d5e1c5733c0944cfe64 (diff) |
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>
-rw-r--r-- | drivers/ide/arm/rapide.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/ide/arm/rapide.c b/drivers/ide/arm/rapide.c index bb081ad53f31..43057e0303c8 100644 --- a/drivers/ide/arm/rapide.c +++ b/drivers/ide/arm/rapide.c | |||
@@ -48,24 +48,26 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
48 | goto release; | 48 | goto release; |
49 | } | 49 | } |
50 | 50 | ||
51 | hwif = ide_find_port(); | 51 | memset(&hw, 0, sizeof(hw)); |
52 | if (hwif) { | 52 | rapide_setup_ports(&hw, base, base + 0x818, 1 << 6, ec->irq); |
53 | memset(&hw, 0, sizeof(hw)); | 53 | hw.chipset = ide_generic; |
54 | rapide_setup_ports(&hw, base, base + 0x818, 1 << 6, ec->irq); | 54 | hw.dev = &ec->dev; |
55 | hw.chipset = ide_generic; | ||
56 | hw.dev = &ec->dev; | ||
57 | 55 | ||
58 | ide_init_port_hw(hwif, &hw); | 56 | hwif = ide_find_port(); |
57 | if (hwif == NULL) { | ||
58 | ret = -ENOENT; | ||
59 | goto release; | ||
60 | } | ||
59 | 61 | ||
60 | default_hwif_mmiops(hwif); | 62 | ide_init_port_hw(hwif, &hw); |
63 | default_hwif_mmiops(hwif); | ||
61 | 64 | ||
62 | idx[0] = hwif->index; | 65 | idx[0] = hwif->index; |
63 | 66 | ||
64 | ide_device_add(idx, &rapide_port_info); | 67 | ide_device_add(idx, &rapide_port_info); |
65 | 68 | ||
66 | ecard_set_drvdata(ec, hwif); | 69 | ecard_set_drvdata(ec, hwif); |
67 | goto out; | 70 | goto out; |
68 | } | ||
69 | 71 | ||
70 | release: | 72 | release: |
71 | ecard_release_resources(ec); | 73 | ecard_release_resources(ec); |