diff options
Diffstat (limited to 'drivers/ide/legacy/dtc2278.c')
| -rw-r--r-- | drivers/ide/legacy/dtc2278.c | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/drivers/ide/legacy/dtc2278.c b/drivers/ide/legacy/dtc2278.c index 9c6b3249a004..f7c4ad1c57c0 100644 --- a/drivers/ide/legacy/dtc2278.c +++ b/drivers/ide/legacy/dtc2278.c | |||
| @@ -16,6 +16,8 @@ | |||
| 16 | 16 | ||
| 17 | #include <asm/io.h> | 17 | #include <asm/io.h> |
| 18 | 18 | ||
| 19 | #define DRV_NAME "dtc2278" | ||
| 20 | |||
| 19 | /* | 21 | /* |
| 20 | * Changing this #undef to #define may solve start up problems in some systems. | 22 | * Changing this #undef to #define may solve start up problems in some systems. |
| 21 | */ | 23 | */ |
| @@ -86,8 +88,14 @@ static void dtc2278_set_pio_mode(ide_drive_t *drive, const u8 pio) | |||
| 86 | } | 88 | } |
| 87 | } | 89 | } |
| 88 | 90 | ||
| 91 | static const struct ide_port_ops dtc2278_port_ops = { | ||
| 92 | .set_pio_mode = dtc2278_set_pio_mode, | ||
| 93 | }; | ||
| 94 | |||
| 89 | static const struct ide_port_info dtc2278_port_info __initdata = { | 95 | static const struct ide_port_info dtc2278_port_info __initdata = { |
| 96 | .name = DRV_NAME, | ||
| 90 | .chipset = ide_dtc2278, | 97 | .chipset = ide_dtc2278, |
| 98 | .port_ops = &dtc2278_port_ops, | ||
| 91 | .host_flags = IDE_HFLAG_SERIALIZE | | 99 | .host_flags = IDE_HFLAG_SERIALIZE | |
| 92 | IDE_HFLAG_NO_UNMASK_IRQS | | 100 | IDE_HFLAG_NO_UNMASK_IRQS | |
| 93 | IDE_HFLAG_IO_32BIT | | 101 | IDE_HFLAG_IO_32BIT | |
| @@ -101,9 +109,6 @@ static const struct ide_port_info dtc2278_port_info __initdata = { | |||
| 101 | static int __init dtc2278_probe(void) | 109 | static int __init dtc2278_probe(void) |
| 102 | { | 110 | { |
| 103 | unsigned long flags; | 111 | unsigned long flags; |
| 104 | ide_hwif_t *hwif, *mate; | ||
| 105 | static u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; | ||
| 106 | hw_regs_t hw[2]; | ||
| 107 | 112 | ||
| 108 | local_irq_save(flags); | 113 | local_irq_save(flags); |
| 109 | /* | 114 | /* |
| @@ -123,30 +128,7 @@ static int __init dtc2278_probe(void) | |||
| 123 | #endif | 128 | #endif |
| 124 | local_irq_restore(flags); | 129 | local_irq_restore(flags); |
| 125 | 130 | ||
| 126 | memset(&hw, 0, sizeof(hw)); | 131 | return ide_legacy_device_add(&dtc2278_port_info, 0); |
| 127 | |||
| 128 | ide_std_init_ports(&hw[0], 0x1f0, 0x3f6); | ||
| 129 | hw[0].irq = 14; | ||
| 130 | |||
| 131 | ide_std_init_ports(&hw[1], 0x170, 0x376); | ||
| 132 | hw[1].irq = 15; | ||
| 133 | |||
| 134 | hwif = ide_find_port(); | ||
| 135 | if (hwif) { | ||
| 136 | ide_init_port_hw(hwif, &hw[0]); | ||
| 137 | hwif->set_pio_mode = dtc2278_set_pio_mode; | ||
| 138 | idx[0] = hwif->index; | ||
| 139 | } | ||
| 140 | |||
| 141 | mate = ide_find_port(); | ||
| 142 | if (mate) { | ||
| 143 | ide_init_port_hw(mate, &hw[1]); | ||
| 144 | idx[1] = mate->index; | ||
| 145 | } | ||
| 146 | |||
| 147 | ide_device_add(idx, &dtc2278_port_info); | ||
| 148 | |||
| 149 | return 0; | ||
| 150 | } | 132 | } |
| 151 | 133 | ||
| 152 | int probe_dtc2278 = 0; | 134 | int probe_dtc2278 = 0; |
