diff options
Diffstat (limited to 'drivers/ide/arm/rapide.c')
-rw-r--r-- | drivers/ide/arm/rapide.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/drivers/ide/arm/rapide.c b/drivers/ide/arm/rapide.c index 0775a3afef48..e6b56d1d48f4 100644 --- a/drivers/ide/arm/rapide.c +++ b/drivers/ide/arm/rapide.c | |||
@@ -13,26 +13,18 @@ | |||
13 | 13 | ||
14 | #include <asm/ecard.h> | 14 | #include <asm/ecard.h> |
15 | 15 | ||
16 | static ide_hwif_t * | 16 | static void rapide_setup_ports(hw_regs_t *hw, void __iomem *base, |
17 | rapide_locate_hwif(void __iomem *base, void __iomem *ctrl, unsigned int sz, int irq) | 17 | void __iomem *ctrl, unsigned int sz, int irq) |
18 | { | 18 | { |
19 | unsigned long port = (unsigned long)base; | 19 | unsigned long port = (unsigned long)base; |
20 | ide_hwif_t *hwif = ide_find_port(port); | ||
21 | int i; | 20 | int i; |
22 | 21 | ||
23 | if (hwif == NULL) | ||
24 | goto out; | ||
25 | |||
26 | for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { | 22 | for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { |
27 | hwif->io_ports[i] = port; | 23 | hw->io_ports[i] = port; |
28 | port += sz; | 24 | port += sz; |
29 | } | 25 | } |
30 | hwif->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl; | 26 | hw->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl; |
31 | hwif->irq = irq; | 27 | hw->irq = irq; |
32 | hwif->mmio = 1; | ||
33 | default_hwif_mmiops(hwif); | ||
34 | out: | ||
35 | return hwif; | ||
36 | } | 28 | } |
37 | 29 | ||
38 | static int __devinit | 30 | static int __devinit |
@@ -42,6 +34,7 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
42 | void __iomem *base; | 34 | void __iomem *base; |
43 | int ret; | 35 | int ret; |
44 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | 36 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; |
37 | hw_regs_t hw; | ||
45 | 38 | ||
46 | ret = ecard_request_resources(ec); | 39 | ret = ecard_request_resources(ec); |
47 | if (ret) | 40 | if (ret) |
@@ -53,11 +46,17 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
53 | goto release; | 46 | goto release; |
54 | } | 47 | } |
55 | 48 | ||
56 | hwif = rapide_locate_hwif(base, base + 0x818, 1 << 6, ec->irq); | 49 | hwif = ide_find_port((unsigned long)base); |
57 | if (hwif) { | 50 | if (hwif) { |
58 | hwif->hwif_data = base; | 51 | memset(&hw, 0, sizeof(hw)); |
59 | hwif->gendev.parent = &ec->dev; | 52 | rapide_setup_ports(&hw, base, base + 0x818, 1 << 6, ec->irq); |
60 | hwif->noprobe = 0; | 53 | hw.chipset = ide_generic; |
54 | hw.dev = &ec->dev; | ||
55 | |||
56 | ide_init_port_hw(hwif, &hw); | ||
57 | |||
58 | hwif->mmio = 1; | ||
59 | default_hwif_mmiops(hwif); | ||
61 | 60 | ||
62 | idx[0] = hwif->index; | 61 | idx[0] = hwif->index; |
63 | 62 | ||