diff options
Diffstat (limited to 'drivers/ide/legacy/q40ide.c')
-rw-r--r-- | drivers/ide/legacy/q40ide.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/drivers/ide/legacy/q40ide.c b/drivers/ide/legacy/q40ide.c index 6ea46a6723e2..f5329730df99 100644 --- a/drivers/ide/legacy/q40ide.c +++ b/drivers/ide/legacy/q40ide.c | |||
@@ -111,15 +111,17 @@ static const char *q40_ide_names[Q40IDE_NUM_HWIFS]={ | |||
111 | * Probe for Q40 IDE interfaces | 111 | * Probe for Q40 IDE interfaces |
112 | */ | 112 | */ |
113 | 113 | ||
114 | void __init q40ide_init(void) | 114 | static int __init q40ide_init(void) |
115 | { | 115 | { |
116 | int i; | 116 | int i; |
117 | ide_hwif_t *hwif; | 117 | ide_hwif_t *hwif; |
118 | int index; | ||
119 | const char *name; | 118 | const char *name; |
119 | u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | ||
120 | 120 | ||
121 | if (!MACH_IS_Q40) | 121 | if (!MACH_IS_Q40) |
122 | return ; | 122 | return -ENODEV; |
123 | |||
124 | printk(KERN_INFO "ide: Q40 IDE controller\n"); | ||
123 | 125 | ||
124 | for (i = 0; i < Q40IDE_NUM_HWIFS; i++) { | 126 | for (i = 0; i < Q40IDE_NUM_HWIFS; i++) { |
125 | hw_regs_t hw; | 127 | hw_regs_t hw; |
@@ -141,10 +143,20 @@ void __init q40ide_init(void) | |||
141 | 0, NULL, | 143 | 0, NULL, |
142 | // m68kide_iops, | 144 | // m68kide_iops, |
143 | q40ide_default_irq(pcide_bases[i])); | 145 | q40ide_default_irq(pcide_bases[i])); |
144 | index = ide_register_hw(&hw, NULL, 1, &hwif); | 146 | |
145 | // **FIXME** | 147 | hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); |
146 | if (index != -1) | 148 | if (hwif) { |
149 | ide_init_port_data(hwif, hwif->index); | ||
150 | ide_init_port_hw(hwif, &hw); | ||
147 | hwif->mmio = 1; | 151 | hwif->mmio = 1; |
152 | |||
153 | idx[i] = hwif->index; | ||
154 | } | ||
148 | } | 155 | } |
156 | |||
157 | ide_device_add(idx); | ||
158 | |||
159 | return 0; | ||
149 | } | 160 | } |
150 | 161 | ||
162 | module_init(q40ide_init); | ||