diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-26 14:13:06 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-26 14:13:06 -0500 |
commit | cbb010c180294a5242a7681555c28737d9dd26ab (patch) | |
tree | 073883d1dc672bb38021563ca0d9cd762cd5abf2 /drivers/ide/legacy/macide.c | |
parent | 57c802e84f9c759c3d1794a9dbe81bc10444df62 (diff) |
ide: drop 'initializing' argument from ide_register_hw()
* Rename init_hwif_data() to ide_init_port_data() and export it.
* For all users of ide_register_hw() with 'initializing' argument set
hwif->present and hwif->hold are always zero so convert these host
drivers to use ide_find_port()+ide_init_port_data()+ide_init_port_hw()
instead (also no need for init_hwif_default() call since the setup
done by it gets over-ridden by ide_init_port_hw() call).
* Drop 'initializing' argument from ide_register_hw().
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/legacy/macide.c')
-rw-r--r-- | drivers/ide/legacy/macide.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/ide/legacy/macide.c b/drivers/ide/legacy/macide.c index 5c6aa77c2370..1840fede5216 100644 --- a/drivers/ide/legacy/macide.c +++ b/drivers/ide/legacy/macide.c | |||
@@ -85,7 +85,6 @@ void __init macide_init(void) | |||
85 | { | 85 | { |
86 | hw_regs_t hw; | 86 | hw_regs_t hw; |
87 | ide_hwif_t *hwif; | 87 | ide_hwif_t *hwif; |
88 | int index = -1; | ||
89 | 88 | ||
90 | switch (macintosh_config->ide_type) { | 89 | switch (macintosh_config->ide_type) { |
91 | case MAC_IDE_QUADRA: | 90 | case MAC_IDE_QUADRA: |
@@ -93,40 +92,40 @@ void __init macide_init(void) | |||
93 | 0, 0, macide_ack_intr, | 92 | 0, 0, macide_ack_intr, |
94 | // quadra_ide_iops, | 93 | // quadra_ide_iops, |
95 | IRQ_NUBUS_F); | 94 | IRQ_NUBUS_F); |
96 | index = ide_register_hw(&hw, NULL, 1, &hwif); | ||
97 | break; | 95 | break; |
98 | case MAC_IDE_PB: | 96 | case MAC_IDE_PB: |
99 | ide_setup_ports(&hw, IDE_BASE, macide_offsets, | 97 | ide_setup_ports(&hw, IDE_BASE, macide_offsets, |
100 | 0, 0, macide_ack_intr, | 98 | 0, 0, macide_ack_intr, |
101 | // macide_pb_iops, | 99 | // macide_pb_iops, |
102 | IRQ_NUBUS_C); | 100 | IRQ_NUBUS_C); |
103 | index = ide_register_hw(&hw, NULL, 1, &hwif); | ||
104 | break; | 101 | break; |
105 | case MAC_IDE_BABOON: | 102 | case MAC_IDE_BABOON: |
106 | ide_setup_ports(&hw, BABOON_BASE, macide_offsets, | 103 | ide_setup_ports(&hw, BABOON_BASE, macide_offsets, |
107 | 0, 0, NULL, | 104 | 0, 0, NULL, |
108 | // macide_baboon_iops, | 105 | // macide_baboon_iops, |
109 | IRQ_BABOON_1); | 106 | IRQ_BABOON_1); |
110 | index = ide_register_hw(&hw, NULL, 1, &hwif); | 107 | break; |
111 | if (index == -1) break; | 108 | default: |
112 | if (macintosh_config->ident == MAC_MODEL_PB190) { | 109 | return; |
110 | } | ||
113 | 111 | ||
112 | hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]); | ||
113 | if (hwif) { | ||
114 | u8 index = hwif->index; | ||
115 | |||
116 | ide_init_port_data(hwif, index); | ||
117 | ide_init_port_hw(hwif, &hw); | ||
118 | |||
119 | if (macintosh_config->ide_type == MAC_IDE_BABOON && | ||
120 | macintosh_config->ident == MAC_MODEL_PB190) { | ||
114 | /* Fix breakage in ide-disk.c: drive capacity */ | 121 | /* Fix breakage in ide-disk.c: drive capacity */ |
115 | /* is not initialized for drives without a */ | 122 | /* is not initialized for drives without a */ |
116 | /* hardware ID, and we can't get that without */ | 123 | /* hardware ID, and we can't get that without */ |
117 | /* probing the drive which freezes a 190. */ | 124 | /* probing the drive which freezes a 190. */ |
118 | 125 | ide_drive_t *drive = &hwif->drives[0]; | |
119 | ide_drive_t *drive = &ide_hwifs[index].drives[0]; | ||
120 | drive->capacity64 = drive->cyl*drive->head*drive->sect; | 126 | drive->capacity64 = drive->cyl*drive->head*drive->sect; |
121 | |||
122 | } | 127 | } |
123 | break; | ||
124 | |||
125 | default: | ||
126 | return; | ||
127 | } | ||
128 | 128 | ||
129 | if (index != -1) { | ||
130 | hwif->mmio = 1; | 129 | hwif->mmio = 1; |
131 | if (macintosh_config->ide_type == MAC_IDE_QUADRA) | 130 | if (macintosh_config->ide_type == MAC_IDE_QUADRA) |
132 | printk(KERN_INFO "ide%d: Macintosh Quadra IDE interface\n", index); | 131 | printk(KERN_INFO "ide%d: Macintosh Quadra IDE interface\n", index); |