aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy/ht6560b.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/ht6560b.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/ht6560b.c')
-rw-r--r--drivers/ide/legacy/ht6560b.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c
index 57bc15cddca0..a89cd80d8124 100644
--- a/drivers/ide/legacy/ht6560b.c
+++ b/drivers/ide/legacy/ht6560b.c
@@ -305,6 +305,15 @@ int probe_ht6560b = 0;
305module_param_named(probe, probe_ht6560b, bool, 0); 305module_param_named(probe, probe_ht6560b, bool, 0);
306MODULE_PARM_DESC(probe, "probe for HT6560B chipset"); 306MODULE_PARM_DESC(probe, "probe for HT6560B chipset");
307 307
308static const struct ide_port_info ht6560b_port_info __initdata = {
309 .chipset = ide_ht6560b,
310 .host_flags = IDE_HFLAG_SERIALIZE | /* is this needed? */
311 IDE_HFLAG_NO_DMA |
312 IDE_HFLAG_NO_AUTOTUNE |
313 IDE_HFLAG_ABUSE_PREFETCH,
314 .pio_mask = ATA_PIO5,
315};
316
308static int __init ht6560b_init(void) 317static int __init ht6560b_init(void)
309{ 318{
310 ide_hwif_t *hwif, *mate; 319 ide_hwif_t *hwif, *mate;
@@ -328,22 +337,11 @@ static int __init ht6560b_init(void)
328 goto release_region; 337 goto release_region;
329 } 338 }
330 339
331 hwif->chipset = ide_ht6560b;
332 hwif->selectproc = &ht6560b_selectproc; 340 hwif->selectproc = &ht6560b_selectproc;
333 hwif->host_flags = IDE_HFLAG_ABUSE_PREFETCH;
334 hwif->pio_mask = ATA_PIO5;
335 hwif->set_pio_mode = &ht6560b_set_pio_mode; 341 hwif->set_pio_mode = &ht6560b_set_pio_mode;
336 hwif->serialized = 1; /* is this needed? */
337 hwif->mate = mate;
338 342
339 mate->chipset = ide_ht6560b;
340 mate->selectproc = &ht6560b_selectproc; 343 mate->selectproc = &ht6560b_selectproc;
341 mate->host_flags = IDE_HFLAG_ABUSE_PREFETCH;
342 mate->pio_mask = ATA_PIO5;
343 mate->set_pio_mode = &ht6560b_set_pio_mode; 344 mate->set_pio_mode = &ht6560b_set_pio_mode;
344 mate->serialized = 1; /* is this needed? */
345 mate->mate = hwif;
346 mate->channel = 1;
347 345
348 /* 346 /*
349 * Setting default configurations for drives 347 * Setting default configurations for drives
@@ -357,7 +355,7 @@ static int __init ht6560b_init(void)
357 mate->drives[0].drive_data = t; 355 mate->drives[0].drive_data = t;
358 mate->drives[1].drive_data = t; 356 mate->drives[1].drive_data = t;
359 357
360 ide_device_add(idx); 358 ide_device_add(idx, &ht6560b_port_info);
361 359
362 return 0; 360 return 0;
363 361