aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy/gayle.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/legacy/gayle.c')
-rw-r--r--drivers/ide/legacy/gayle.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/ide/legacy/gayle.c b/drivers/ide/legacy/gayle.c
index 7baeefa870fa..13d22bded6b4 100644
--- a/drivers/ide/legacy/gayle.c
+++ b/drivers/ide/legacy/gayle.c
@@ -127,9 +127,9 @@ static int __init gayle_init(void)
127 unsigned long phys_base, res_start, res_n; 127 unsigned long phys_base, res_start, res_n;
128 unsigned long base, ctrlport, irqport; 128 unsigned long base, ctrlport, irqport;
129 ide_ack_intr_t *ack_intr; 129 ide_ack_intr_t *ack_intr;
130 struct ide_host *host;
130 int a4000, i; 131 int a4000, i;
131 hw_regs_t hw[GAYLE_NUM_HWIFS], *hws[] = { NULL, NULL, NULL, NULL }; 132 hw_regs_t hw[GAYLE_NUM_HWIFS], *hws[] = { NULL, NULL, NULL, NULL };
132 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
133 133
134 if (!MACH_IS_AMIGA) 134 if (!MACH_IS_AMIGA)
135 return -ENODEV; 135 return -ENODEV;
@@ -172,23 +172,17 @@ found:
172 return -EBUSY; 172 return -EBUSY;
173 173
174 for (i = 0; i < GAYLE_NUM_PROBE_HWIFS; i++) { 174 for (i = 0; i < GAYLE_NUM_PROBE_HWIFS; i++) {
175 ide_hwif_t *hwif;
176
177 base = (unsigned long)ZTWO_VADDR(phys_base + i * GAYLE_NEXT_PORT); 175 base = (unsigned long)ZTWO_VADDR(phys_base + i * GAYLE_NEXT_PORT);
178 ctrlport = GAYLE_HAS_CONTROL_REG ? (base + GAYLE_CONTROL) : 0; 176 ctrlport = GAYLE_HAS_CONTROL_REG ? (base + GAYLE_CONTROL) : 0;
179 177
180 gayle_setup_ports(&hw[i], base, ctrlport, irqport, ack_intr); 178 gayle_setup_ports(&hw[i], base, ctrlport, irqport, ack_intr);
181 179
182 hwif = ide_find_port(); 180 hws[i] = &hw[i];
183 if (hwif) {
184 hwif->chipset = ide_generic;
185
186 hws[i] = &hw[i];
187 idx[i] = hwif->index;
188 }
189 } 181 }
190 182
191 ide_device_add(idx, NULL, hws); 183 host = ide_host_alloc(NULL, hws);
184 if (host)
185 ide_host_register(host, NULL, hws);
192 186
193 return 0; 187 return 0;
194} 188}