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/piix.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/piix.c')
-rw-r--r-- | drivers/ide/pci/piix.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c index 89d74ffdb207..21c5dd23f928 100644 --- a/drivers/ide/pci/piix.c +++ b/drivers/ide/pci/piix.c | |||
@@ -285,11 +285,6 @@ static u8 __devinit piix_cable_detect(ide_hwif_t *hwif) | |||
285 | 285 | ||
286 | static void __devinit init_hwif_piix(ide_hwif_t *hwif) | 286 | static void __devinit init_hwif_piix(ide_hwif_t *hwif) |
287 | { | 287 | { |
288 | hwif->set_pio_mode = &piix_set_pio_mode; | ||
289 | hwif->set_dma_mode = &piix_set_dma_mode; | ||
290 | |||
291 | hwif->cable_detect = piix_cable_detect; | ||
292 | |||
293 | if (!hwif->dma_base) | 288 | if (!hwif->dma_base) |
294 | return; | 289 | return; |
295 | 290 | ||
@@ -306,6 +301,12 @@ static void __devinit init_hwif_ich(ide_hwif_t *hwif) | |||
306 | hwif->ide_dma_clear_irq = &piix_dma_clear_irq; | 301 | hwif->ide_dma_clear_irq = &piix_dma_clear_irq; |
307 | } | 302 | } |
308 | 303 | ||
304 | static const struct ide_port_ops piix_port_ops = { | ||
305 | .set_pio_mode = piix_set_pio_mode, | ||
306 | .set_dma_mode = piix_set_dma_mode, | ||
307 | .cable_detect = piix_cable_detect, | ||
308 | }; | ||
309 | |||
309 | #ifndef CONFIG_IA64 | 310 | #ifndef CONFIG_IA64 |
310 | #define IDE_HFLAGS_PIIX IDE_HFLAG_LEGACY_IRQS | 311 | #define IDE_HFLAGS_PIIX IDE_HFLAG_LEGACY_IRQS |
311 | #else | 312 | #else |
@@ -317,6 +318,7 @@ static void __devinit init_hwif_ich(ide_hwif_t *hwif) | |||
317 | .name = name_str, \ | 318 | .name = name_str, \ |
318 | .init_hwif = init_hwif_piix, \ | 319 | .init_hwif = init_hwif_piix, \ |
319 | .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, \ | 320 | .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, \ |
321 | .port_ops = &piix_port_ops, \ | ||
320 | .host_flags = IDE_HFLAGS_PIIX, \ | 322 | .host_flags = IDE_HFLAGS_PIIX, \ |
321 | .pio_mask = ATA_PIO4, \ | 323 | .pio_mask = ATA_PIO4, \ |
322 | .swdma_mask = ATA_SWDMA2_ONLY, \ | 324 | .swdma_mask = ATA_SWDMA2_ONLY, \ |
@@ -330,6 +332,7 @@ static void __devinit init_hwif_ich(ide_hwif_t *hwif) | |||
330 | .init_chipset = init_chipset_ich, \ | 332 | .init_chipset = init_chipset_ich, \ |
331 | .init_hwif = init_hwif_ich, \ | 333 | .init_hwif = init_hwif_ich, \ |
332 | .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, \ | 334 | .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, \ |
335 | .port_ops = &piix_port_ops, \ | ||
333 | .host_flags = IDE_HFLAGS_PIIX, \ | 336 | .host_flags = IDE_HFLAGS_PIIX, \ |
334 | .pio_mask = ATA_PIO4, \ | 337 | .pio_mask = ATA_PIO4, \ |
335 | .swdma_mask = ATA_SWDMA2_ONLY, \ | 338 | .swdma_mask = ATA_SWDMA2_ONLY, \ |