aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/riva/nv_driver.c
diff options
context:
space:
mode:
authorAlan Cox <alan@redhat.com>2007-05-08 03:39:28 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:15:32 -0400
commitd37363409bacd1142c6e49edfb3e1f8b153d47dc (patch)
tree2aa26a4e06020b714192f746a11c0be4c7b7c5fb /drivers/video/riva/nv_driver.c
parentdbe7e429fedb3fbc93b496cc1c3eb4fc28333ac0 (diff)
nvidiafb/rivafb: switch to pci_get refcounting
Switch to pci_get refcounting APIs [adaplas] Fix a long-standing bug where the return value of pci_find_slot()/pci_get_bus_and_slot() is ignored. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Antonino Daplas <adaplas@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/riva/nv_driver.c')
-rw-r--r--drivers/video/riva/nv_driver.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/video/riva/nv_driver.c b/drivers/video/riva/nv_driver.c
index be630a0ccfd4..a11026812d1b 100644
--- a/drivers/video/riva/nv_driver.c
+++ b/drivers/video/riva/nv_driver.c
@@ -231,12 +231,14 @@ unsigned long riva_get_memlen(struct riva_par *par)
231 case NV_ARCH_30: 231 case NV_ARCH_30:
232 if(chipset == NV_CHIP_IGEFORCE2) { 232 if(chipset == NV_CHIP_IGEFORCE2) {
233 233
234 dev = pci_find_slot(0, 1); 234 dev = pci_get_bus_and_slot(0, 1);
235 pci_read_config_dword(dev, 0x7C, &amt); 235 pci_read_config_dword(dev, 0x7C, &amt);
236 pci_dev_put(dev);
236 memlen = (((amt >> 6) & 31) + 1) * 1024; 237 memlen = (((amt >> 6) & 31) + 1) * 1024;
237 } else if (chipset == NV_CHIP_0x01F0) { 238 } else if (chipset == NV_CHIP_0x01F0) {
238 dev = pci_find_slot(0, 1); 239 dev = pci_get_bus_and_slot(0, 1);
239 pci_read_config_dword(dev, 0x84, &amt); 240 pci_read_config_dword(dev, 0x84, &amt);
241 pci_dev_put(dev);
240 memlen = (((amt >> 4) & 127) + 1) * 1024; 242 memlen = (((amt >> 4) & 127) + 1) * 1024;
241 } else { 243 } else {
242 switch ((NV_RD32(chip->PFB, 0x0000020C) >> 20) & 244 switch ((NV_RD32(chip->PFB, 0x0000020C) >> 20) &