diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-01 17:09:31 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-01 17:09:31 -0500 |
commit | 36501650ec45b1db308c3b51886044863be2d762 (patch) | |
tree | 74cf9d9f313e510f8424f9bac35da8d61cce9f7b /drivers/ide/pci/serverworks.c | |
parent | f6fb786d6dcdd7d730e4fba620b071796f487e1b (diff) |
ide: keep pointer to struct device instead of struct pci_dev in ide_hwif_t
Keep pointer to struct device instead of struct pci_dev in ide_hwif_t.
While on it:
* Use *dev->dma_mask instead of pci_dev->dma_mask in ide_toggle_bounce().
There should be no functionality changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/serverworks.c')
-rw-r--r-- | drivers/ide/pci/serverworks.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c index bf01c387739e..cb10dfa71f5c 100644 --- a/drivers/ide/pci/serverworks.c +++ b/drivers/ide/pci/serverworks.c | |||
@@ -67,7 +67,7 @@ static int check_in_drive_lists (ide_drive_t *drive, const char **list) | |||
67 | 67 | ||
68 | static u8 svwks_udma_filter(ide_drive_t *drive) | 68 | static u8 svwks_udma_filter(ide_drive_t *drive) |
69 | { | 69 | { |
70 | struct pci_dev *dev = HWIF(drive)->pci_dev; | 70 | struct pci_dev *dev = to_pci_dev(drive->hwif->dev); |
71 | u8 mask = 0; | 71 | u8 mask = 0; |
72 | 72 | ||
73 | if (dev->device == PCI_DEVICE_ID_SERVERWORKS_HT1000IDE) | 73 | if (dev->device == PCI_DEVICE_ID_SERVERWORKS_HT1000IDE) |
@@ -130,7 +130,7 @@ static void svwks_set_pio_mode(ide_drive_t *drive, const u8 pio) | |||
130 | static const u8 pio_modes[] = { 0x5d, 0x47, 0x34, 0x22, 0x20 }; | 130 | static const u8 pio_modes[] = { 0x5d, 0x47, 0x34, 0x22, 0x20 }; |
131 | static const u8 drive_pci[] = { 0x41, 0x40, 0x43, 0x42 }; | 131 | static const u8 drive_pci[] = { 0x41, 0x40, 0x43, 0x42 }; |
132 | 132 | ||
133 | struct pci_dev *dev = drive->hwif->pci_dev; | 133 | struct pci_dev *dev = to_pci_dev(drive->hwif->dev); |
134 | 134 | ||
135 | pci_write_config_byte(dev, drive_pci[drive->dn], pio_modes[pio]); | 135 | pci_write_config_byte(dev, drive_pci[drive->dn], pio_modes[pio]); |
136 | 136 | ||
@@ -153,7 +153,7 @@ static void svwks_set_dma_mode(ide_drive_t *drive, const u8 speed) | |||
153 | static const u8 drive_pci2[] = { 0x45, 0x44, 0x47, 0x46 }; | 153 | static const u8 drive_pci2[] = { 0x45, 0x44, 0x47, 0x46 }; |
154 | 154 | ||
155 | ide_hwif_t *hwif = HWIF(drive); | 155 | ide_hwif_t *hwif = HWIF(drive); |
156 | struct pci_dev *dev = hwif->pci_dev; | 156 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
157 | u8 unit = (drive->select.b.unit & 0x01); | 157 | u8 unit = (drive->select.b.unit & 0x01); |
158 | 158 | ||
159 | u8 ultra_enable = 0, ultra_timing = 0, dma_timing = 0; | 159 | u8 ultra_enable = 0, ultra_timing = 0, dma_timing = 0; |
@@ -287,7 +287,8 @@ static u8 __devinit ata66_svwks_svwks(ide_hwif_t *hwif) | |||
287 | */ | 287 | */ |
288 | static u8 __devinit ata66_svwks_dell(ide_hwif_t *hwif) | 288 | static u8 __devinit ata66_svwks_dell(ide_hwif_t *hwif) |
289 | { | 289 | { |
290 | struct pci_dev *dev = hwif->pci_dev; | 290 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
291 | |||
291 | if (dev->subsystem_vendor == PCI_VENDOR_ID_DELL && | 292 | if (dev->subsystem_vendor == PCI_VENDOR_ID_DELL && |
292 | dev->vendor == PCI_VENDOR_ID_SERVERWORKS && | 293 | dev->vendor == PCI_VENDOR_ID_SERVERWORKS && |
293 | (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE || | 294 | (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE || |
@@ -305,7 +306,8 @@ static u8 __devinit ata66_svwks_dell(ide_hwif_t *hwif) | |||
305 | */ | 306 | */ |
306 | static u8 __devinit ata66_svwks_cobalt(ide_hwif_t *hwif) | 307 | static u8 __devinit ata66_svwks_cobalt(ide_hwif_t *hwif) |
307 | { | 308 | { |
308 | struct pci_dev *dev = hwif->pci_dev; | 309 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
310 | |||
309 | if (dev->subsystem_vendor == PCI_VENDOR_ID_SUN && | 311 | if (dev->subsystem_vendor == PCI_VENDOR_ID_SUN && |
310 | dev->vendor == PCI_VENDOR_ID_SERVERWORKS && | 312 | dev->vendor == PCI_VENDOR_ID_SERVERWORKS && |
311 | dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE) | 313 | dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE) |
@@ -316,7 +318,7 @@ static u8 __devinit ata66_svwks_cobalt(ide_hwif_t *hwif) | |||
316 | 318 | ||
317 | static u8 __devinit ata66_svwks(ide_hwif_t *hwif) | 319 | static u8 __devinit ata66_svwks(ide_hwif_t *hwif) |
318 | { | 320 | { |
319 | struct pci_dev *dev = hwif->pci_dev; | 321 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
320 | 322 | ||
321 | /* Server Works */ | 323 | /* Server Works */ |
322 | if (dev->subsystem_vendor == PCI_VENDOR_ID_SERVERWORKS) | 324 | if (dev->subsystem_vendor == PCI_VENDOR_ID_SERVERWORKS) |
@@ -340,6 +342,8 @@ static u8 __devinit ata66_svwks(ide_hwif_t *hwif) | |||
340 | 342 | ||
341 | static void __devinit init_hwif_svwks (ide_hwif_t *hwif) | 343 | static void __devinit init_hwif_svwks (ide_hwif_t *hwif) |
342 | { | 344 | { |
345 | struct pci_dev *dev = to_pci_dev(hwif->dev); | ||
346 | |||
343 | hwif->set_pio_mode = &svwks_set_pio_mode; | 347 | hwif->set_pio_mode = &svwks_set_pio_mode; |
344 | hwif->set_dma_mode = &svwks_set_dma_mode; | 348 | hwif->set_dma_mode = &svwks_set_dma_mode; |
345 | hwif->udma_filter = &svwks_udma_filter; | 349 | hwif->udma_filter = &svwks_udma_filter; |
@@ -347,7 +351,7 @@ static void __devinit init_hwif_svwks (ide_hwif_t *hwif) | |||
347 | if (!hwif->dma_base) | 351 | if (!hwif->dma_base) |
348 | return; | 352 | return; |
349 | 353 | ||
350 | if (hwif->pci_dev->device != PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) { | 354 | if (dev->device != PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) { |
351 | if (hwif->cbl != ATA_CBL_PATA40_SHORT) | 355 | if (hwif->cbl != ATA_CBL_PATA40_SHORT) |
352 | hwif->cbl = ata66_svwks(hwif); | 356 | hwif->cbl = ata66_svwks(hwif); |
353 | } | 357 | } |