diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 16:25:14 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 16:25:14 -0400 |
commit | ac95beedf8bc97b24f9540d4da9952f07221c023 (patch) | |
tree | c29837142c8083b6fcaf1767abcb0a4533676cd1 /drivers/ide/pci/amd74xx.c | |
parent | 4a27214d7be31e122db4102166f49ec15958e8e9 (diff) |
ide: add struct ide_port_ops (take 2)
* Move hooks for port/host specific methods from ide_hwif_t to
'struct ide_port_ops'.
* Add 'const struct ide_port_ops *port_ops' to 'struct ide_port_info'
and ide_hwif_t.
* Update host drivers and core code accordingly.
While at it:
* Rename ata66_*() cable detect functions to *_cable_detect() to match
the standard naming. (Suggested by Sergei Shtylyov)
v2:
* Fix build for bast-ide. (Noticed by Andrew Morton)
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/amd74xx.c')
-rw-r--r-- | drivers/ide/pci/amd74xx.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c index ff684d312378..f7c883808b02 100644 --- a/drivers/ide/pci/amd74xx.c +++ b/drivers/ide/pci/amd74xx.c | |||
@@ -210,13 +210,14 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif) | |||
210 | 210 | ||
211 | if (hwif->irq == 0) /* 0 is bogus but will do for now */ | 211 | if (hwif->irq == 0) /* 0 is bogus but will do for now */ |
212 | hwif->irq = pci_get_legacy_ide_irq(dev, hwif->channel); | 212 | hwif->irq = pci_get_legacy_ide_irq(dev, hwif->channel); |
213 | |||
214 | hwif->set_pio_mode = &amd_set_pio_mode; | ||
215 | hwif->set_dma_mode = &amd_set_drive; | ||
216 | |||
217 | hwif->cable_detect = amd_cable_detect; | ||
218 | } | 213 | } |
219 | 214 | ||
215 | static const struct ide_port_ops amd_port_ops = { | ||
216 | .set_pio_mode = amd_set_pio_mode, | ||
217 | .set_dma_mode = amd_set_drive, | ||
218 | .cable_detect = amd_cable_detect, | ||
219 | }; | ||
220 | |||
220 | #define IDE_HFLAGS_AMD \ | 221 | #define IDE_HFLAGS_AMD \ |
221 | (IDE_HFLAG_PIO_NO_BLACKLIST | \ | 222 | (IDE_HFLAG_PIO_NO_BLACKLIST | \ |
222 | IDE_HFLAG_ABUSE_SET_DMA_MODE | \ | 223 | IDE_HFLAG_ABUSE_SET_DMA_MODE | \ |
@@ -230,6 +231,7 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif) | |||
230 | .init_chipset = init_chipset_amd74xx, \ | 231 | .init_chipset = init_chipset_amd74xx, \ |
231 | .init_hwif = init_hwif_amd74xx, \ | 232 | .init_hwif = init_hwif_amd74xx, \ |
232 | .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, \ | 233 | .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, \ |
234 | .port_ops = &amd_port_ops, \ | ||
233 | .host_flags = IDE_HFLAGS_AMD, \ | 235 | .host_flags = IDE_HFLAGS_AMD, \ |
234 | .pio_mask = ATA_PIO5, \ | 236 | .pio_mask = ATA_PIO5, \ |
235 | .swdma_mask = swdma, \ | 237 | .swdma_mask = swdma, \ |
@@ -243,6 +245,7 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif) | |||
243 | .init_chipset = init_chipset_amd74xx, \ | 245 | .init_chipset = init_chipset_amd74xx, \ |
244 | .init_hwif = init_hwif_amd74xx, \ | 246 | .init_hwif = init_hwif_amd74xx, \ |
245 | .enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}}, \ | 247 | .enablebits = {{0x50,0x02,0x02}, {0x50,0x01,0x01}}, \ |
248 | .port_ops = &amd_port_ops, \ | ||
246 | .host_flags = IDE_HFLAGS_AMD, \ | 249 | .host_flags = IDE_HFLAGS_AMD, \ |
247 | .pio_mask = ATA_PIO5, \ | 250 | .pio_mask = ATA_PIO5, \ |
248 | .swdma_mask = ATA_SWDMA2, \ | 251 | .swdma_mask = ATA_SWDMA2, \ |