diff options
Diffstat (limited to 'drivers/ide/pci/sc1200.c')
-rw-r--r-- | drivers/ide/pci/sc1200.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c index 32fdf53379f5..af499a60eb31 100644 --- a/drivers/ide/pci/sc1200.c +++ b/drivers/ide/pci/sc1200.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * linux/drivers/ide/pci/sc1200.c Version 0.97 Aug 3 2007 | ||
3 | * | ||
4 | * Copyright (C) 2000-2002 Mark Lord <mlord@pobox.com> | 2 | * Copyright (C) 2000-2002 Mark Lord <mlord@pobox.com> |
5 | * Copyright (C) 2007 Bartlomiej Zolnierkiewicz | 3 | * Copyright (C) 2007 Bartlomiej Zolnierkiewicz |
6 | * | 4 | * |
@@ -87,7 +85,7 @@ static const unsigned int sc1200_pio_timings[4][5] = | |||
87 | static void sc1200_tunepio(ide_drive_t *drive, u8 pio) | 85 | static void sc1200_tunepio(ide_drive_t *drive, u8 pio) |
88 | { | 86 | { |
89 | ide_hwif_t *hwif = drive->hwif; | 87 | ide_hwif_t *hwif = drive->hwif; |
90 | struct pci_dev *pdev = hwif->pci_dev; | 88 | struct pci_dev *pdev = to_pci_dev(hwif->dev); |
91 | unsigned int basereg = hwif->channel ? 0x50 : 0x40, format = 0; | 89 | unsigned int basereg = hwif->channel ? 0x50 : 0x40, format = 0; |
92 | 90 | ||
93 | pci_read_config_dword(pdev, basereg + 4, &format); | 91 | pci_read_config_dword(pdev, basereg + 4, &format); |
@@ -130,6 +128,7 @@ out: | |||
130 | static void sc1200_set_dma_mode(ide_drive_t *drive, const u8 mode) | 128 | static void sc1200_set_dma_mode(ide_drive_t *drive, const u8 mode) |
131 | { | 129 | { |
132 | ide_hwif_t *hwif = HWIF(drive); | 130 | ide_hwif_t *hwif = HWIF(drive); |
131 | struct pci_dev *dev = to_pci_dev(hwif->dev); | ||
133 | int unit = drive->select.b.unit; | 132 | int unit = drive->select.b.unit; |
134 | unsigned int reg, timings; | 133 | unsigned int reg, timings; |
135 | unsigned short pci_clock; | 134 | unsigned short pci_clock; |
@@ -160,12 +159,11 @@ static void sc1200_set_dma_mode(ide_drive_t *drive, const u8 mode) | |||
160 | timings = mwdma_timing[pci_clock][mode - XFER_MW_DMA_0]; | 159 | timings = mwdma_timing[pci_clock][mode - XFER_MW_DMA_0]; |
161 | 160 | ||
162 | if (unit == 0) { /* are we configuring drive0? */ | 161 | if (unit == 0) { /* are we configuring drive0? */ |
163 | pci_read_config_dword(hwif->pci_dev, basereg+4, ®); | 162 | pci_read_config_dword(dev, basereg + 4, ®); |
164 | timings |= reg & 0x80000000; /* preserve PIO format bit */ | 163 | timings |= reg & 0x80000000; /* preserve PIO format bit */ |
165 | pci_write_config_dword(hwif->pci_dev, basereg+4, timings); | 164 | pci_write_config_dword(dev, basereg + 4, timings); |
166 | } else { | 165 | } else |
167 | pci_write_config_dword(hwif->pci_dev, basereg+12, timings); | 166 | pci_write_config_dword(dev, basereg + 12, timings); |
168 | } | ||
169 | } | 167 | } |
170 | 168 | ||
171 | /* Replacement for the standard ide_dma_end action in | 169 | /* Replacement for the standard ide_dma_end action in |