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/it8213.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/it8213.c')
-rw-r--r-- | drivers/ide/pci/it8213.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/ide/pci/it8213.c b/drivers/ide/pci/it8213.c index 5b5b0cc4b76a..9053c8771e6e 100644 --- a/drivers/ide/pci/it8213.c +++ b/drivers/ide/pci/it8213.c | |||
@@ -149,27 +149,17 @@ static u8 __devinit it8213_cable_detect(ide_hwif_t *hwif) | |||
149 | return (reg42h & 0x02) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; | 149 | return (reg42h & 0x02) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; |
150 | } | 150 | } |
151 | 151 | ||
152 | /** | 152 | static const struct ide_port_ops it8213_port_ops = { |
153 | * init_hwif_it8213 - set up hwif structs | 153 | .set_pio_mode = it8213_set_pio_mode, |
154 | * @hwif: interface to set up | 154 | .set_dma_mode = it8213_set_dma_mode, |
155 | * | 155 | .cable_detect = it8213_cable_detect, |
156 | * We do the basic set up of the interface structure. | 156 | }; |
157 | */ | ||
158 | |||
159 | static void __devinit init_hwif_it8213(ide_hwif_t *hwif) | ||
160 | { | ||
161 | hwif->set_dma_mode = &it8213_set_dma_mode; | ||
162 | hwif->set_pio_mode = &it8213_set_pio_mode; | ||
163 | |||
164 | hwif->cable_detect = it8213_cable_detect; | ||
165 | } | ||
166 | |||
167 | 157 | ||
168 | #define DECLARE_ITE_DEV(name_str) \ | 158 | #define DECLARE_ITE_DEV(name_str) \ |
169 | { \ | 159 | { \ |
170 | .name = name_str, \ | 160 | .name = name_str, \ |
171 | .init_hwif = init_hwif_it8213, \ | ||
172 | .enablebits = { {0x41, 0x80, 0x80} }, \ | 161 | .enablebits = { {0x41, 0x80, 0x80} }, \ |
162 | .port_ops = &it8213_port_ops, \ | ||
173 | .host_flags = IDE_HFLAG_SINGLE, \ | 163 | .host_flags = IDE_HFLAG_SINGLE, \ |
174 | .pio_mask = ATA_PIO4, \ | 164 | .pio_mask = ATA_PIO4, \ |
175 | .swdma_mask = ATA_SWDMA2_ONLY, \ | 165 | .swdma_mask = ATA_SWDMA2_ONLY, \ |