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/sis5513.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/sis5513.c')
-rw-r--r-- | drivers/ide/pci/sis5513.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c index 85d36996e6af..9fb4ba4ee318 100644 --- a/drivers/ide/pci/sis5513.c +++ b/drivers/ide/pci/sis5513.c | |||
@@ -197,7 +197,7 @@ static char* chipset_capability[] = { | |||
197 | 197 | ||
198 | static u8 sis_ata133_get_base(ide_drive_t *drive) | 198 | static u8 sis_ata133_get_base(ide_drive_t *drive) |
199 | { | 199 | { |
200 | struct pci_dev *dev = drive->hwif->pci_dev; | 200 | struct pci_dev *dev = to_pci_dev(drive->hwif->dev); |
201 | u32 reg54 = 0; | 201 | u32 reg54 = 0; |
202 | 202 | ||
203 | pci_read_config_dword(dev, 0x54, ®54); | 203 | pci_read_config_dword(dev, 0x54, ®54); |
@@ -207,7 +207,7 @@ static u8 sis_ata133_get_base(ide_drive_t *drive) | |||
207 | 207 | ||
208 | static void sis_ata16_program_timings(ide_drive_t *drive, const u8 mode) | 208 | static void sis_ata16_program_timings(ide_drive_t *drive, const u8 mode) |
209 | { | 209 | { |
210 | struct pci_dev *dev = drive->hwif->pci_dev; | 210 | struct pci_dev *dev = to_pci_dev(drive->hwif->dev); |
211 | u16 t1 = 0; | 211 | u16 t1 = 0; |
212 | u8 drive_pci = 0x40 + drive->dn * 2; | 212 | u8 drive_pci = 0x40 + drive->dn * 2; |
213 | 213 | ||
@@ -230,7 +230,7 @@ static void sis_ata16_program_timings(ide_drive_t *drive, const u8 mode) | |||
230 | 230 | ||
231 | static void sis_ata100_program_timings(ide_drive_t *drive, const u8 mode) | 231 | static void sis_ata100_program_timings(ide_drive_t *drive, const u8 mode) |
232 | { | 232 | { |
233 | struct pci_dev *dev = drive->hwif->pci_dev; | 233 | struct pci_dev *dev = to_pci_dev(drive->hwif->dev); |
234 | u8 t1, drive_pci = 0x40 + drive->dn * 2; | 234 | u8 t1, drive_pci = 0x40 + drive->dn * 2; |
235 | 235 | ||
236 | /* timing bits: 7:4 active 3:0 recovery */ | 236 | /* timing bits: 7:4 active 3:0 recovery */ |
@@ -253,7 +253,7 @@ static void sis_ata100_program_timings(ide_drive_t *drive, const u8 mode) | |||
253 | 253 | ||
254 | static void sis_ata133_program_timings(ide_drive_t *drive, const u8 mode) | 254 | static void sis_ata133_program_timings(ide_drive_t *drive, const u8 mode) |
255 | { | 255 | { |
256 | struct pci_dev *dev = drive->hwif->pci_dev; | 256 | struct pci_dev *dev = to_pci_dev(drive->hwif->dev); |
257 | u32 t1 = 0; | 257 | u32 t1 = 0; |
258 | u8 drive_pci = sis_ata133_get_base(drive), clk, idx; | 258 | u8 drive_pci = sis_ata133_get_base(drive), clk, idx; |
259 | 259 | ||
@@ -286,7 +286,7 @@ static void sis_program_timings(ide_drive_t *drive, const u8 mode) | |||
286 | static void config_drive_art_rwp (ide_drive_t *drive) | 286 | static void config_drive_art_rwp (ide_drive_t *drive) |
287 | { | 287 | { |
288 | ide_hwif_t *hwif = HWIF(drive); | 288 | ide_hwif_t *hwif = HWIF(drive); |
289 | struct pci_dev *dev = hwif->pci_dev; | 289 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
290 | u8 reg4bh = 0; | 290 | u8 reg4bh = 0; |
291 | u8 rw_prefetch = 0; | 291 | u8 rw_prefetch = 0; |
292 | 292 | ||
@@ -307,7 +307,7 @@ static void sis_set_pio_mode(ide_drive_t *drive, const u8 pio) | |||
307 | 307 | ||
308 | static void sis_ata133_program_udma_timings(ide_drive_t *drive, const u8 mode) | 308 | static void sis_ata133_program_udma_timings(ide_drive_t *drive, const u8 mode) |
309 | { | 309 | { |
310 | struct pci_dev *dev = drive->hwif->pci_dev; | 310 | struct pci_dev *dev = to_pci_dev(drive->hwif->dev); |
311 | u32 regdw = 0; | 311 | u32 regdw = 0; |
312 | u8 drive_pci = sis_ata133_get_base(drive), clk, idx; | 312 | u8 drive_pci = sis_ata133_get_base(drive), clk, idx; |
313 | 313 | ||
@@ -326,7 +326,7 @@ static void sis_ata133_program_udma_timings(ide_drive_t *drive, const u8 mode) | |||
326 | 326 | ||
327 | static void sis_ata33_program_udma_timings(ide_drive_t *drive, const u8 mode) | 327 | static void sis_ata33_program_udma_timings(ide_drive_t *drive, const u8 mode) |
328 | { | 328 | { |
329 | struct pci_dev *dev = drive->hwif->pci_dev; | 329 | struct pci_dev *dev = to_pci_dev(drive->hwif->dev); |
330 | u8 drive_pci = 0x40 + drive->dn * 2, reg = 0, i = chipset_family; | 330 | u8 drive_pci = 0x40 + drive->dn * 2, reg = 0, i = chipset_family; |
331 | 331 | ||
332 | pci_read_config_byte(dev, drive_pci + 1, ®); | 332 | pci_read_config_byte(dev, drive_pci + 1, ®); |
@@ -359,7 +359,7 @@ static void sis_set_dma_mode(ide_drive_t *drive, const u8 speed) | |||
359 | 359 | ||
360 | static u8 sis5513_ata133_udma_filter(ide_drive_t *drive) | 360 | static u8 sis5513_ata133_udma_filter(ide_drive_t *drive) |
361 | { | 361 | { |
362 | struct pci_dev *dev = drive->hwif->pci_dev; | 362 | struct pci_dev *dev = to_pci_dev(drive->hwif->dev); |
363 | u32 regdw = 0; | 363 | u32 regdw = 0; |
364 | u8 drive_pci = sis_ata133_get_base(drive); | 364 | u8 drive_pci = sis_ata133_get_base(drive); |
365 | 365 | ||
@@ -530,7 +530,7 @@ static const struct sis_laptop sis_laptop[] = { | |||
530 | 530 | ||
531 | static u8 __devinit ata66_sis5513(ide_hwif_t *hwif) | 531 | static u8 __devinit ata66_sis5513(ide_hwif_t *hwif) |
532 | { | 532 | { |
533 | struct pci_dev *pdev = hwif->pci_dev; | 533 | struct pci_dev *pdev = to_pci_dev(hwif->dev); |
534 | const struct sis_laptop *lap = &sis_laptop[0]; | 534 | const struct sis_laptop *lap = &sis_laptop[0]; |
535 | u8 ata66 = 0; | 535 | u8 ata66 = 0; |
536 | 536 | ||
@@ -545,12 +545,12 @@ static u8 __devinit ata66_sis5513(ide_hwif_t *hwif) | |||
545 | if (chipset_family >= ATA_133) { | 545 | if (chipset_family >= ATA_133) { |
546 | u16 regw = 0; | 546 | u16 regw = 0; |
547 | u16 reg_addr = hwif->channel ? 0x52: 0x50; | 547 | u16 reg_addr = hwif->channel ? 0x52: 0x50; |
548 | pci_read_config_word(hwif->pci_dev, reg_addr, ®w); | 548 | pci_read_config_word(pdev, reg_addr, ®w); |
549 | ata66 = (regw & 0x8000) ? 0 : 1; | 549 | ata66 = (regw & 0x8000) ? 0 : 1; |
550 | } else if (chipset_family >= ATA_66) { | 550 | } else if (chipset_family >= ATA_66) { |
551 | u8 reg48h = 0; | 551 | u8 reg48h = 0; |
552 | u8 mask = hwif->channel ? 0x20 : 0x10; | 552 | u8 mask = hwif->channel ? 0x20 : 0x10; |
553 | pci_read_config_byte(hwif->pci_dev, 0x48, ®48h); | 553 | pci_read_config_byte(pdev, 0x48, ®48h); |
554 | ata66 = (reg48h & mask) ? 0 : 1; | 554 | ata66 = (reg48h & mask) ? 0 : 1; |
555 | } | 555 | } |
556 | 556 | ||