aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy/dtc2278.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-02 13:56:31 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-02 13:56:31 -0500
commitc413b9b94d9a8e7548cc4b2e04b7df0439ce76fd (patch)
tree5d23110a0d1f87ad0c88fb1746194e532808eaab /drivers/ide/legacy/dtc2278.c
parent1ebf74936b1fccb5b65940f99ccddd74ec4d1fef (diff)
ide: add struct ide_port_info instances to legacy host drivers
* Remove 'struct pci_dev *dev' argument from ide_hwif_setup_dma(). * Un-static ide_hwif_setup_dma() and add CONFIG_BLK_DEV_IDEDMA_PCI=n version. * Add 'const struct ide_port_info *d' argument to ide_device_add[_all](). * Factor out generic ports init from ide_pci_setup_ports() to ide_init_port(), move it to ide-probe.c and call it in in ide_device_add_all() instead of ide_pci_setup_ports(). * Move ->mate setup to ide_device_add_all() from ide_port_init(). * Add IDE_HFLAG_NO_AUTOTUNE host flag for host drivers that don't enable ->autotune currently. * Setup hwif->chipset in ide_init_port() but iff pi->chipset is set (to not override setup done by ide_hwif_configure()). * Add ETRAX host handling to ide_device_add_all(). * cmd640.c: set IDE_HFLAG_ABUSE_* also for CONFIG_BLK_DEV_CMD640_ENHANCED=n. * pmac.c: make pmac_ide_setup_dma() return an error value and move DMA masks setup to pmac_ide_setup_device(). * Add 'struct ide_port_info' instances to legacy host drivers, pass them to ide_device_add() calls and then remove open-coded ports initialization. Reviewed-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/legacy/dtc2278.c')
-rw-r--r--drivers/ide/legacy/dtc2278.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/ide/legacy/dtc2278.c b/drivers/ide/legacy/dtc2278.c
index 092c04abbe7a..7cbf2f1f35f9 100644
--- a/drivers/ide/legacy/dtc2278.c
+++ b/drivers/ide/legacy/dtc2278.c
@@ -86,6 +86,15 @@ static void dtc2278_set_pio_mode(ide_drive_t *drive, const u8 pio)
86 } 86 }
87} 87}
88 88
89static const struct ide_port_info dtc2278_port_info __initdata = {
90 .chipset = ide_dtc2278,
91 .host_flags = IDE_HFLAG_SERIALIZE |
92 IDE_HFLAG_IO_32BIT |
93 IDE_HFLAG_NO_DMA |
94 IDE_HFLAG_NO_AUTOTUNE,
95 .pio_mask = ATA_PIO4,
96};
97
89static int __init dtc2278_probe(void) 98static int __init dtc2278_probe(void)
90{ 99{
91 unsigned long flags; 100 unsigned long flags;
@@ -116,29 +125,16 @@ static int __init dtc2278_probe(void)
116#endif 125#endif
117 local_irq_restore(flags); 126 local_irq_restore(flags);
118 127
119 hwif->serialized = 1;
120 hwif->no_io_32bit = 1; /* disallow ->io_32bit changes */ 128 hwif->no_io_32bit = 1; /* disallow ->io_32bit changes */
121 hwif->chipset = ide_dtc2278;
122 hwif->pio_mask = ATA_PIO4;
123 hwif->set_pio_mode = &dtc2278_set_pio_mode; 129 hwif->set_pio_mode = &dtc2278_set_pio_mode;
124 hwif->drives[0].no_unmask = 1; 130 hwif->drives[0].no_unmask = 1;
125 hwif->drives[1].no_unmask = 1; 131 hwif->drives[1].no_unmask = 1;
126 hwif->drives[0].io_32bit = 1;
127 hwif->drives[1].io_32bit = 1;
128 hwif->mate = mate;
129 132
130 mate->serialized = 1;
131 mate->no_io_32bit = 1; 133 mate->no_io_32bit = 1;
132 mate->chipset = ide_dtc2278;
133 mate->pio_mask = ATA_PIO4;
134 mate->drives[0].no_unmask = 1; 134 mate->drives[0].no_unmask = 1;
135 mate->drives[1].no_unmask = 1; 135 mate->drives[1].no_unmask = 1;
136 mate->drives[0].io_32bit = 1;
137 mate->drives[1].io_32bit = 1;
138 mate->mate = hwif;
139 mate->channel = 1;
140 136
141 ide_device_add(idx); 137 ide_device_add(idx, &dtc2278_port_info);
142 138
143 return 0; 139 return 0;
144} 140}