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/jmicron.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/jmicron.c')
-rw-r--r-- | drivers/ide/pci/jmicron.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/drivers/ide/pci/jmicron.c b/drivers/ide/pci/jmicron.c index 673f7dc8ba65..96ef7394f283 100644 --- a/drivers/ide/pci/jmicron.c +++ b/drivers/ide/pci/jmicron.c | |||
@@ -19,13 +19,13 @@ typedef enum { | |||
19 | } port_type; | 19 | } port_type; |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * ata66_jmicron - Cable check | 22 | * jmicron_cable_detect - cable detection |
23 | * @hwif: IDE port | 23 | * @hwif: IDE port |
24 | * | 24 | * |
25 | * Returns the cable type. | 25 | * Returns the cable type. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | static u8 __devinit ata66_jmicron(ide_hwif_t *hwif) | 28 | static u8 __devinit jmicron_cable_detect(ide_hwif_t *hwif) |
29 | { | 29 | { |
30 | struct pci_dev *pdev = to_pci_dev(hwif->dev); | 30 | struct pci_dev *pdev = to_pci_dev(hwif->dev); |
31 | 31 | ||
@@ -95,25 +95,16 @@ static void jmicron_set_dma_mode(ide_drive_t *drive, const u8 mode) | |||
95 | { | 95 | { |
96 | } | 96 | } |
97 | 97 | ||
98 | /** | 98 | static const struct ide_port_ops jmicron_port_ops = { |
99 | * init_hwif_jmicron - set up hwif structs | 99 | .set_pio_mode = jmicron_set_pio_mode, |
100 | * @hwif: interface to set up | 100 | .set_dma_mode = jmicron_set_dma_mode, |
101 | * | 101 | .cable_detect = jmicron_cable_detect, |
102 | * Minimal set up is required for the Jmicron hardware. | 102 | }; |
103 | */ | ||
104 | |||
105 | static void __devinit init_hwif_jmicron(ide_hwif_t *hwif) | ||
106 | { | ||
107 | hwif->set_pio_mode = &jmicron_set_pio_mode; | ||
108 | hwif->set_dma_mode = &jmicron_set_dma_mode; | ||
109 | |||
110 | hwif->cable_detect = ata66_jmicron; | ||
111 | } | ||
112 | 103 | ||
113 | static const struct ide_port_info jmicron_chipset __devinitdata = { | 104 | static const struct ide_port_info jmicron_chipset __devinitdata = { |
114 | .name = "JMB", | 105 | .name = "JMB", |
115 | .init_hwif = init_hwif_jmicron, | ||
116 | .enablebits = { { 0x40, 0x01, 0x01 }, { 0x40, 0x10, 0x10 } }, | 106 | .enablebits = { { 0x40, 0x01, 0x01 }, { 0x40, 0x10, 0x10 } }, |
107 | .port_ops = &jmicron_port_ops, | ||
117 | .pio_mask = ATA_PIO5, | 108 | .pio_mask = ATA_PIO5, |
118 | .mwdma_mask = ATA_MWDMA2, | 109 | .mwdma_mask = ATA_MWDMA2, |
119 | .udma_mask = ATA_UDMA6, | 110 | .udma_mask = ATA_UDMA6, |