aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy/umc8672.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/legacy/umc8672.c')
-rw-r--r--drivers/ide/legacy/umc8672.c37
1 files changed, 9 insertions, 28 deletions
diff --git a/drivers/ide/legacy/umc8672.c b/drivers/ide/legacy/umc8672.c
index 4d90badd2bda..17d515329fe0 100644
--- a/drivers/ide/legacy/umc8672.c
+++ b/drivers/ide/legacy/umc8672.c
@@ -51,6 +51,8 @@
51 51
52#include <asm/io.h> 52#include <asm/io.h>
53 53
54#define DRV_NAME "umc8672"
55
54/* 56/*
55 * Default speeds. These can be changed with "auto-tune" and/or hdparm. 57 * Default speeds. These can be changed with "auto-tune" and/or hdparm.
56 */ 58 */
@@ -120,18 +122,21 @@ static void umc_set_pio_mode(ide_drive_t *drive, const u8 pio)
120 spin_unlock_irqrestore(&ide_lock, flags); 122 spin_unlock_irqrestore(&ide_lock, flags);
121} 123}
122 124
125static const struct ide_port_ops umc8672_port_ops = {
126 .set_pio_mode = umc_set_pio_mode,
127};
128
123static const struct ide_port_info umc8672_port_info __initdata = { 129static const struct ide_port_info umc8672_port_info __initdata = {
130 .name = DRV_NAME,
124 .chipset = ide_umc8672, 131 .chipset = ide_umc8672,
132 .port_ops = &umc8672_port_ops,
125 .host_flags = IDE_HFLAG_NO_DMA | IDE_HFLAG_NO_AUTOTUNE, 133 .host_flags = IDE_HFLAG_NO_DMA | IDE_HFLAG_NO_AUTOTUNE,
126 .pio_mask = ATA_PIO4, 134 .pio_mask = ATA_PIO4,
127}; 135};
128 136
129static int __init umc8672_probe(void) 137static int __init umc8672_probe(void)
130{ 138{
131 ide_hwif_t *hwif, *mate;
132 unsigned long flags; 139 unsigned long flags;
133 static u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
134 hw_regs_t hw[2];
135 140
136 if (!request_region(0x108, 2, "umc8672")) { 141 if (!request_region(0x108, 2, "umc8672")) {
137 printk(KERN_ERR "umc8672: ports 0x108-0x109 already in use.\n"); 142 printk(KERN_ERR "umc8672: ports 0x108-0x109 already in use.\n");
@@ -150,31 +155,7 @@ static int __init umc8672_probe(void)
150 umc_set_speeds(current_speeds); 155 umc_set_speeds(current_speeds);
151 local_irq_restore(flags); 156 local_irq_restore(flags);
152 157
153 memset(&hw, 0, sizeof(hw)); 158 return ide_legacy_device_add(&umc8672_port_info, 0);
154
155 ide_std_init_ports(&hw[0], 0x1f0, 0x3f6);
156 hw[0].irq = 14;
157
158 ide_std_init_ports(&hw[1], 0x170, 0x376);
159 hw[1].irq = 15;
160
161 hwif = ide_find_port();
162 if (hwif) {
163 ide_init_port_hw(hwif, &hw[0]);
164 hwif->set_pio_mode = umc_set_pio_mode;
165 idx[0] = hwif->index;
166 }
167
168 mate = ide_find_port();
169 if (mate) {
170 ide_init_port_hw(mate, &hw[1]);
171 mate->set_pio_mode = umc_set_pio_mode;
172 idx[1] = mate->index;
173 }
174
175 ide_device_add(idx, &umc8672_port_info);
176
177 return 0;
178} 159}
179 160
180int probe_umc8672; 161int probe_umc8672;