summaryrefslogtreecommitdiff
blob: b291a3a7219c7027fcc2917536d0c0de90743537 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
2005-03-02 22:32            diff -lu or.c agpgart_be.c            Page 1


--- or.c	2005-01-31 19:50:00.000000000 +0200
+++ agpgart_be.c	2005-03-02 22:19:25.000000000 +0200
@@ -261,6 +261,12 @@
 #define firegl_pci_find_class(class,from) pci_find_class(class,from)
 #endif
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11) 
+#define firegl_pci_find_class(class,from) pci_get_class(class,from)
+#else
+#define firegl_pci_find_class(class,from) pci_find_class(class,from)
+#endif
+
 int agp_backend_acquire(void)
 {
 	if (agp_bridge.type == NOT_SUPPORTED) {
@@ -4075,6 +4081,13 @@
 			}
 		}
 	}
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11) 
+            // the reference count has been increased in agp_backend_initialize.
+        if (device)
+            pci_dev_put(device); 
+#endif
+
 	/*
 	 * PASS3: Figure out the 8X/4X setting and enable the
 	 *        target (our motherboard chipset).
@@ -5283,6 +5296,12 @@
             pci_dev_put(device); 
 #endif
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11) 
+            // the reference count has been increased in agp_backend_initialize.
+        if (device)
+            pci_dev_put(device); 
+#endif
+
     return(0); /* success */
 }
 
@@ -7428,6 +7447,11 @@
 		return rc;
 	}
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
+        // decrease the reference count.
+        pci_dev_put(agp_bridge.dev);
+#endif
+
 	if (agp_bridge.needs_scratch_page == TRUE) {
 		agp_bridge.scratch_page = agp_bridge.agp_alloc_page();