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/sl82c105.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/sl82c105.c')
-rw-r--r-- | drivers/ide/pci/sl82c105.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c index c7a125b66c29..38a79688abc5 100644 --- a/drivers/ide/pci/sl82c105.c +++ b/drivers/ide/pci/sl82c105.c | |||
@@ -78,7 +78,7 @@ static unsigned int get_pio_timings(ide_drive_t *drive, u8 pio) | |||
78 | */ | 78 | */ |
79 | static void sl82c105_set_pio_mode(ide_drive_t *drive, const u8 pio) | 79 | static void sl82c105_set_pio_mode(ide_drive_t *drive, const u8 pio) |
80 | { | 80 | { |
81 | struct pci_dev *dev = HWIF(drive)->pci_dev; | 81 | struct pci_dev *dev = to_pci_dev(drive->hwif->dev); |
82 | int reg = 0x44 + drive->dn * 4; | 82 | int reg = 0x44 + drive->dn * 4; |
83 | u16 drv_ctrl; | 83 | u16 drv_ctrl; |
84 | 84 | ||
@@ -147,7 +147,7 @@ static inline void sl82c105_reset_host(struct pci_dev *dev) | |||
147 | static void sl82c105_dma_lost_irq(ide_drive_t *drive) | 147 | static void sl82c105_dma_lost_irq(ide_drive_t *drive) |
148 | { | 148 | { |
149 | ide_hwif_t *hwif = HWIF(drive); | 149 | ide_hwif_t *hwif = HWIF(drive); |
150 | struct pci_dev *dev = hwif->pci_dev; | 150 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
151 | u32 val, mask = hwif->channel ? CTRL_IDE_IRQB : CTRL_IDE_IRQA; | 151 | u32 val, mask = hwif->channel ? CTRL_IDE_IRQB : CTRL_IDE_IRQA; |
152 | u8 dma_cmd; | 152 | u8 dma_cmd; |
153 | 153 | ||
@@ -184,7 +184,7 @@ static void sl82c105_dma_lost_irq(ide_drive_t *drive) | |||
184 | static void sl82c105_dma_start(ide_drive_t *drive) | 184 | static void sl82c105_dma_start(ide_drive_t *drive) |
185 | { | 185 | { |
186 | ide_hwif_t *hwif = HWIF(drive); | 186 | ide_hwif_t *hwif = HWIF(drive); |
187 | struct pci_dev *dev = hwif->pci_dev; | 187 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
188 | int reg = 0x44 + drive->dn * 4; | 188 | int reg = 0x44 + drive->dn * 4; |
189 | 189 | ||
190 | DBG(("%s(drive:%s)\n", __FUNCTION__, drive->name)); | 190 | DBG(("%s(drive:%s)\n", __FUNCTION__, drive->name)); |
@@ -197,15 +197,17 @@ static void sl82c105_dma_start(ide_drive_t *drive) | |||
197 | 197 | ||
198 | static void sl82c105_dma_timeout(ide_drive_t *drive) | 198 | static void sl82c105_dma_timeout(ide_drive_t *drive) |
199 | { | 199 | { |
200 | struct pci_dev *dev = to_pci_dev(drive->hwif->dev); | ||
201 | |||
200 | DBG(("sl82c105_dma_timeout(drive:%s)\n", drive->name)); | 202 | DBG(("sl82c105_dma_timeout(drive:%s)\n", drive->name)); |
201 | 203 | ||
202 | sl82c105_reset_host(HWIF(drive)->pci_dev); | 204 | sl82c105_reset_host(dev); |
203 | ide_dma_timeout(drive); | 205 | ide_dma_timeout(drive); |
204 | } | 206 | } |
205 | 207 | ||
206 | static int sl82c105_dma_end(ide_drive_t *drive) | 208 | static int sl82c105_dma_end(ide_drive_t *drive) |
207 | { | 209 | { |
208 | struct pci_dev *dev = HWIF(drive)->pci_dev; | 210 | struct pci_dev *dev = to_pci_dev(drive->hwif->dev); |
209 | int reg = 0x44 + drive->dn * 4; | 211 | int reg = 0x44 + drive->dn * 4; |
210 | int ret; | 212 | int ret; |
211 | 213 | ||
@@ -224,7 +226,7 @@ static int sl82c105_dma_end(ide_drive_t *drive) | |||
224 | */ | 226 | */ |
225 | static void sl82c105_resetproc(ide_drive_t *drive) | 227 | static void sl82c105_resetproc(ide_drive_t *drive) |
226 | { | 228 | { |
227 | struct pci_dev *dev = HWIF(drive)->pci_dev; | 229 | struct pci_dev *dev = to_pci_dev(drive->hwif->dev); |
228 | u32 val; | 230 | u32 val; |
229 | 231 | ||
230 | DBG(("sl82c105_resetproc(drive:%s)\n", drive->name)); | 232 | DBG(("sl82c105_resetproc(drive:%s)\n", drive->name)); |
@@ -293,6 +295,7 @@ static unsigned int __devinit init_chipset_sl82c105(struct pci_dev *dev, const c | |||
293 | */ | 295 | */ |
294 | static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif) | 296 | static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif) |
295 | { | 297 | { |
298 | struct pci_dev *dev = to_pci_dev(hwif->dev); | ||
296 | unsigned int rev; | 299 | unsigned int rev; |
297 | 300 | ||
298 | DBG(("init_hwif_sl82c105(hwif: ide%d)\n", hwif->index)); | 301 | DBG(("init_hwif_sl82c105(hwif: ide%d)\n", hwif->index)); |
@@ -304,7 +307,7 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif) | |||
304 | if (!hwif->dma_base) | 307 | if (!hwif->dma_base) |
305 | return; | 308 | return; |
306 | 309 | ||
307 | rev = sl82c105_bridge_revision(hwif->pci_dev); | 310 | rev = sl82c105_bridge_revision(dev); |
308 | if (rev <= 5) { | 311 | if (rev <= 5) { |
309 | /* | 312 | /* |
310 | * Never ever EVER under any circumstances enable | 313 | * Never ever EVER under any circumstances enable |