diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-02 18:56:31 (GMT) |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-02 18:56:31 (GMT) |
commit | c413b9b94d9a8e7548cc4b2e04b7df0439ce76fd (patch) | |
tree | 5d23110a0d1f87ad0c88fb1746194e532808eaab /drivers/ide/legacy | |
parent | 1ebf74936b1fccb5b65940f99ccddd74ec4d1fef (diff) | |
download | linux-c413b9b94d9a8e7548cc4b2e04b7df0439ce76fd.tar.xz |
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')
-rw-r--r-- | drivers/ide/legacy/ali14xx.c | 24 | ||||
-rw-r--r-- | drivers/ide/legacy/buddha.c | 2 | ||||
-rw-r--r-- | drivers/ide/legacy/dtc2278.c | 24 | ||||
-rw-r--r-- | drivers/ide/legacy/falconide.c | 2 | ||||
-rw-r--r-- | drivers/ide/legacy/gayle.c | 2 | ||||
-rw-r--r-- | drivers/ide/legacy/ht6560b.c | 22 | ||||
-rw-r--r-- | drivers/ide/legacy/ide_platform.c | 2 | ||||
-rw-r--r-- | drivers/ide/legacy/macide.c | 2 | ||||
-rw-r--r-- | drivers/ide/legacy/q40ide.c | 2 | ||||
-rw-r--r-- | drivers/ide/legacy/qd65xx.c | 23 | ||||
-rw-r--r-- | drivers/ide/legacy/umc8672.c | 24 |
11 files changed, 57 insertions, 72 deletions
diff --git a/drivers/ide/legacy/ali14xx.c b/drivers/ide/legacy/ali14xx.c index e3ea209..d4d1a6b 100644 --- a/drivers/ide/legacy/ali14xx.c +++ b/drivers/ide/legacy/ali14xx.c @@ -191,9 +191,14 @@ static int __init initRegisters (void) { return t; } +static const struct ide_port_info ali14xx_port_info = { + .chipset = ide_ali14xx, + .host_flags = IDE_HFLAG_NO_DMA | IDE_HFLAG_NO_AUTOTUNE, + .pio_mask = ATA_PIO4, +}; + static int __init ali14xx_probe(void) { - ide_hwif_t *hwif, *mate; static u8 idx[4] = { 0, 1, 0xff, 0xff }; printk(KERN_DEBUG "ali14xx: base=0x%03x, regOn=0x%02x.\n", @@ -205,21 +210,10 @@ static int __init ali14xx_probe(void) return 1; } - hwif = &ide_hwifs[0]; - mate = &ide_hwifs[1]; - - hwif->chipset = ide_ali14xx; - hwif->pio_mask = ATA_PIO4; - hwif->set_pio_mode = &ali14xx_set_pio_mode; - hwif->mate = mate; - - mate->chipset = ide_ali14xx; - mate->pio_mask = ATA_PIO4; - mate->set_pio_mode = &ali14xx_set_pio_mode; - mate->mate = hwif; - mate->channel = 1; + ide_hwifs[0].set_pio_mode = &ali14xx_set_pio_mode; + ide_hwifs[1].set_pio_mode = &ali14xx_set_pio_mode; - ide_device_add(idx); + ide_device_add(idx, &ali14xx_port_info); return 0; } diff --git a/drivers/ide/legacy/buddha.c b/drivers/ide/legacy/buddha.c index dd3d198..8bdb79d 100644 --- a/drivers/ide/legacy/buddha.c +++ b/drivers/ide/legacy/buddha.c @@ -232,7 +232,7 @@ fail_base2: } } - ide_device_add(idx); + ide_device_add(idx, NULL); } return 0; diff --git a/drivers/ide/legacy/dtc2278.c b/drivers/ide/legacy/dtc2278.c index 092c04a..7cbf2f1 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) } } +static const struct ide_port_info dtc2278_port_info __initdata = { + .chipset = ide_dtc2278, + .host_flags = IDE_HFLAG_SERIALIZE | + IDE_HFLAG_IO_32BIT | + IDE_HFLAG_NO_DMA | + IDE_HFLAG_NO_AUTOTUNE, + .pio_mask = ATA_PIO4, +}; + static int __init dtc2278_probe(void) { unsigned long flags; @@ -116,29 +125,16 @@ static int __init dtc2278_probe(void) #endif local_irq_restore(flags); - hwif->serialized = 1; hwif->no_io_32bit = 1; /* disallow ->io_32bit changes */ - hwif->chipset = ide_dtc2278; - hwif->pio_mask = ATA_PIO4; hwif->set_pio_mode = &dtc2278_set_pio_mode; hwif->drives[0].no_unmask = 1; hwif->drives[1].no_unmask = 1; - hwif->drives[0].io_32bit = 1; - hwif->drives[1].io_32bit = 1; - hwif->mate = mate; - mate->serialized = 1; mate->no_io_32bit = 1; - mate->chipset = ide_dtc2278; - mate->pio_mask = ATA_PIO4; mate->drives[0].no_unmask = 1; mate->drives[1].no_unmask = 1; - mate->drives[0].io_32bit = 1; - mate->drives[1].io_32bit = 1; - mate->mate = hwif; - mate->channel = 1; - ide_device_add(idx); + ide_device_add(idx, &dtc2278_port_info); return 0; } diff --git a/drivers/ide/legacy/falconide.c b/drivers/ide/legacy/falconide.c index c9bd6bf..85b69a8 100644 --- a/drivers/ide/legacy/falconide.c +++ b/drivers/ide/legacy/falconide.c @@ -83,7 +83,7 @@ static int __init falconide_init(void) ide_init_port_data(hwif, index); ide_init_port_hw(hwif, &hw); - ide_device_add(idx); + ide_device_add(idx, NULL); } } diff --git a/drivers/ide/legacy/gayle.c b/drivers/ide/legacy/gayle.c index f67c51a..fc29ce7 100644 --- a/drivers/ide/legacy/gayle.c +++ b/drivers/ide/legacy/gayle.c @@ -186,7 +186,7 @@ found: release_mem_region(res_start, res_n); } - ide_device_add(idx); + ide_device_add(idx, NULL); return 0; } diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c index 57bc15c..a89cd80 100644 --- a/drivers/ide/legacy/ht6560b.c +++ b/drivers/ide/legacy/ht6560b.c @@ -305,6 +305,15 @@ int probe_ht6560b = 0; module_param_named(probe, probe_ht6560b, bool, 0); MODULE_PARM_DESC(probe, "probe for HT6560B chipset"); +static const struct ide_port_info ht6560b_port_info __initdata = { + .chipset = ide_ht6560b, + .host_flags = IDE_HFLAG_SERIALIZE | /* is this needed? */ + IDE_HFLAG_NO_DMA | + IDE_HFLAG_NO_AUTOTUNE | + IDE_HFLAG_ABUSE_PREFETCH, + .pio_mask = ATA_PIO5, +}; + static int __init ht6560b_init(void) { ide_hwif_t *hwif, *mate; @@ -328,22 +337,11 @@ static int __init ht6560b_init(void) goto release_region; } - hwif->chipset = ide_ht6560b; hwif->selectproc = &ht6560b_selectproc; - hwif->host_flags = IDE_HFLAG_ABUSE_PREFETCH; - hwif->pio_mask = ATA_PIO5; hwif->set_pio_mode = &ht6560b_set_pio_mode; - hwif->serialized = 1; /* is this needed? */ - hwif->mate = mate; - mate->chipset = ide_ht6560b; mate->selectproc = &ht6560b_selectproc; - mate->host_flags = IDE_HFLAG_ABUSE_PREFETCH; - mate->pio_mask = ATA_PIO5; mate->set_pio_mode = &ht6560b_set_pio_mode; - mate->serialized = 1; /* is this needed? */ - mate->mate = hwif; - mate->channel = 1; /* * Setting default configurations for drives @@ -357,7 +355,7 @@ static int __init ht6560b_init(void) mate->drives[0].drive_data = t; mate->drives[1].drive_data = t; - ide_device_add(idx); + ide_device_add(idx, &ht6560b_port_info); return 0; diff --git a/drivers/ide/legacy/ide_platform.c b/drivers/ide/legacy/ide_platform.c index 7c3231a..7c7f42a1ff 100644 --- a/drivers/ide/legacy/ide_platform.c +++ b/drivers/ide/legacy/ide_platform.c @@ -108,7 +108,7 @@ static int __devinit plat_ide_probe(struct platform_device *pdev) idx[0] = hwif->index; - ide_device_add(idx); + ide_device_add(idx, NULL); platform_set_drvdata(pdev, hwif); diff --git a/drivers/ide/legacy/macide.c b/drivers/ide/legacy/macide.c index 12cd26d..06df8df 100644 --- a/drivers/ide/legacy/macide.c +++ b/drivers/ide/legacy/macide.c @@ -125,7 +125,7 @@ static int __init macide_init(void) hwif->mmio = 1; - ide_device_add(idx); + ide_device_add(idx, NULL); } return 0; diff --git a/drivers/ide/legacy/q40ide.c b/drivers/ide/legacy/q40ide.c index a9c6b06..2f0b34d 100644 --- a/drivers/ide/legacy/q40ide.c +++ b/drivers/ide/legacy/q40ide.c @@ -154,7 +154,7 @@ static int __init q40ide_init(void) } } - ide_device_add(idx); + ide_device_add(idx, NULL); return 0; } diff --git a/drivers/ide/legacy/qd65xx.c b/drivers/ide/legacy/qd65xx.c index 37534bb..60a6ed1 100644 --- a/drivers/ide/legacy/qd65xx.c +++ b/drivers/ide/legacy/qd65xx.c @@ -308,15 +308,10 @@ static int __init qd_testreg(int port) static void __init qd_setup(ide_hwif_t *hwif, int base, int config, unsigned int data0, unsigned int data1) { - hwif->chipset = ide_qd65xx; - hwif->channel = hwif->index; hwif->select_data = base; hwif->config_data = config; hwif->drives[0].drive_data = data0; hwif->drives[1].drive_data = data1; - hwif->drives[0].io_32bit = - hwif->drives[1].io_32bit = 1; - hwif->pio_mask = ATA_PIO4; } /* @@ -356,6 +351,14 @@ static void __exit qd_unsetup(ide_hwif_t *hwif) } */ +static const struct ide_port_info qd65xx_port_info __initdata = { + .chipset = ide_qd65xx, + .host_flags = IDE_HFLAG_IO_32BIT | + IDE_HFLAG_NO_DMA | + IDE_HFLAG_NO_AUTOTUNE, + .pio_mask = ATA_PIO4, +}; + /* * qd_probe: * @@ -397,9 +400,9 @@ static int __init qd_probe(int base) hwif->set_pio_mode = &qd6500_set_pio_mode; - idx[0] = unit; + idx[unit] = unit; - ide_device_add(idx); + ide_device_add(idx, &qd65xx_port_info); return 1; } @@ -431,9 +434,9 @@ static int __init qd_probe(int base) hwif->set_pio_mode = &qd6580_set_pio_mode; - idx[0] = unit; + idx[unit] = unit; - ide_device_add(idx); + ide_device_add(idx, &qd65xx_port_info); outb(QD_DEF_CONTR, QD_CONTROL_PORT); @@ -460,7 +463,7 @@ static int __init qd_probe(int base) idx[0] = 0; idx[1] = 1; - ide_device_add(idx); + ide_device_add(idx, &qd65xx_port_info); outb(QD_DEF_CONTR, QD_CONTROL_PORT); diff --git a/drivers/ide/legacy/umc8672.c b/drivers/ide/legacy/umc8672.c index 26f38ce..5696ba0 100644 --- a/drivers/ide/legacy/umc8672.c +++ b/drivers/ide/legacy/umc8672.c @@ -120,9 +120,14 @@ static void umc_set_pio_mode(ide_drive_t *drive, const u8 pio) spin_unlock_irqrestore(&ide_lock, flags); } +static const struct ide_port_info umc8672_port_info __initdata = { + .chipset = ide_umc8672, + .host_flags = IDE_HFLAG_NO_DMA | IDE_HFLAG_NO_AUTOTUNE, + .pio_mask = ATA_PIO4, +}; + static int __init umc8672_probe(void) { - ide_hwif_t *hwif, *mate; unsigned long flags; static u8 idx[4] = { 0, 1, 0xff, 0xff }; @@ -143,21 +148,10 @@ static int __init umc8672_probe(void) umc_set_speeds (current_speeds); local_irq_restore(flags); - hwif = &ide_hwifs[0]; - mate = &ide_hwifs[1]; - - hwif->chipset = ide_umc8672; - hwif->pio_mask = ATA_PIO4; - hwif->set_pio_mode = &umc_set_pio_mode; - hwif->mate = mate; - - mate->chipset = ide_umc8672; - mate->pio_mask = ATA_PIO4; - mate->set_pio_mode = &umc_set_pio_mode; - mate->mate = hwif; - mate->channel = 1; + ide_hwifs[0].set_pio_mode = &umc_set_pio_mode; + ide_hwifs[1].set_pio_mode = &umc_set_pio_mode; - ide_device_add(idx); + ide_device_add(idx, &umc8672_port_info); return 0; } |