aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/pdc202xx_new.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 16:25:14 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 16:25:14 -0400
commitac95beedf8bc97b24f9540d4da9952f07221c023 (patch)
treec29837142c8083b6fcaf1767abcb0a4533676cd1 /drivers/ide/pci/pdc202xx_new.c
parent4a27214d7be31e122db4102166f49ec15958e8e9 (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/pdc202xx_new.c')
-rw-r--r--drivers/ide/pci/pdc202xx_new.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index 1c8cb7797a4a..35a249cfe03f 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -442,17 +442,6 @@ static unsigned int __devinit init_chipset_pdcnew(struct pci_dev *dev, const cha
442 return dev->irq; 442 return dev->irq;
443} 443}
444 444
445static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif)
446{
447 hwif->set_pio_mode = &pdcnew_set_pio_mode;
448 hwif->set_dma_mode = &pdcnew_set_dma_mode;
449
450 hwif->quirkproc = &pdcnew_quirkproc;
451 hwif->resetproc = &pdcnew_reset;
452
453 hwif->cable_detect = pdcnew_cable_detect;
454}
455
456static struct pci_dev * __devinit pdc20270_get_dev2(struct pci_dev *dev) 445static struct pci_dev * __devinit pdc20270_get_dev2(struct pci_dev *dev)
457{ 446{
458 struct pci_dev *dev2; 447 struct pci_dev *dev2;
@@ -476,11 +465,19 @@ static struct pci_dev * __devinit pdc20270_get_dev2(struct pci_dev *dev)
476 return NULL; 465 return NULL;
477} 466}
478 467
468static const struct ide_port_ops pdcnew_port_ops = {
469 .set_pio_mode = pdcnew_set_pio_mode,
470 .set_dma_mode = pdcnew_set_dma_mode,
471 .quirkproc = pdcnew_quirkproc,
472 .resetproc = pdcnew_reset,
473 .cable_detect = pdcnew_cable_detect,
474};
475
479#define DECLARE_PDCNEW_DEV(name_str, udma) \ 476#define DECLARE_PDCNEW_DEV(name_str, udma) \
480 { \ 477 { \
481 .name = name_str, \ 478 .name = name_str, \
482 .init_chipset = init_chipset_pdcnew, \ 479 .init_chipset = init_chipset_pdcnew, \
483 .init_hwif = init_hwif_pdc202new, \ 480 .port_ops = &pdcnew_port_ops, \
484 .host_flags = IDE_HFLAG_POST_SET_MODE | \ 481 .host_flags = IDE_HFLAG_POST_SET_MODE | \
485 IDE_HFLAG_ERROR_STOPS_FIFO | \ 482 IDE_HFLAG_ERROR_STOPS_FIFO | \
486 IDE_HFLAG_OFF_BOARD, \ 483 IDE_HFLAG_OFF_BOARD, \