bk://linux-dj.bkbits.net/agpgart
davej@dhcp83-103.boston.redhat.com|ChangeSet|20041101210739|54979 davej

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/11/03 13:08:01-08:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/11/03 13:07:57-08:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/11/01 16:07:39-05:00 davej@dhcp83-103.boston.redhat.com 
#   Cset exclude: davej@redhat.com|ChangeSet|20041028185758|54148
# 
# drivers/char/agp/generic.c
#   2004/11/01 16:07:37-05:00 davej@dhcp83-103.boston.redhat.com +0 -0
#   Exclude
# 
# drivers/char/agp/backend.c
#   2004/11/01 16:07:37-05:00 davej@dhcp83-103.boston.redhat.com +0 -0
#   Exclude
# 
# ChangeSet
#   2004/10/28 14:40:59-07:00 akpm@bix.(none) 
#   Merge bk://linux-dj.bkbits.net/agpgart
#   into bix.(none):/usr/src/bk-agpgart
# 
# drivers/char/agp/intel-mch-agp.c
#   2004/10/28 14:40:56-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# drivers/char/agp/intel-agp.c
#   2004/10/28 14:40:56-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/28 15:13:09-04:00 davej@redhat.com 
#   [AGPGART] sis-agp.c: replace pci_find_device with pci_get_device
#   
#   As pci_find_device is going away soon I have converted this file to use
#   pci_get_device instead. for_each_pci_dev is a macro wrapper around
#   pci_get_device.  I have compile tested it. If anyone has this hardware
#   and could test it that would be great.
#   
#   Signed-off-by: Hanna Linder <hannal@us.ibm.com>
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# drivers/char/agp/sis-agp.c
#   2004/10/28 15:13:02-04:00 davej@redhat.com +1 -1
#   [AGPGART] sis-agp.c: replace pci_find_device with pci_get_device
#   
#   As pci_find_device is going away soon I have converted this file to use
#   pci_get_device instead. for_each_pci_dev is a macro wrapper around
#   pci_get_device.  I have compile tested it. If anyone has this hardware
#   and could test it that would be great.
#   
#   Signed-off-by: Hanna Linder <hannal@us.ibm.com>
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# ChangeSet
#   2004/10/28 15:12:23-04:00 davej@redhat.com 
#   [AGPGART] isoch.c: replace pci_find_device with pci_get_device
#   
#   As pci_find_device is going away soon I have converted this file to use
#   pci_get_device instead. for_each_pci_dev is just a macro wrapper around
#   pci_get_device.  I have compile tested it. If anyone has this hardware
#   and could test it that would be great.
#   
#   Signed-off-by: Hanna Linder <hannal@us.ibm.com>
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# drivers/char/agp/isoch.c
#   2004/10/28 15:12:17-04:00 davej@redhat.com +1 -1
#   [AGPGART] isoch.c: replace pci_find_device with pci_get_device
#   
#   As pci_find_device is going away soon I have converted this file to use
#   pci_get_device instead. for_each_pci_dev is just a macro wrapper around
#   pci_get_device.  I have compile tested it. If anyone has this hardware
#   and could test it that would be great.
#   
#   Signed-off-by: Hanna Linder <hannal@us.ibm.com>
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# ChangeSet
#   2004/10/28 15:11:35-04:00 davej@redhat.com 
#   [AGPGART] intel-mch-agp.c: replace pci_find_device with pci_get_device
#   
#   As pci_find_device is going away soon I have converted this file to use
#   pci_get_device instead. I have compile tested it. If anyone has this hardware
#   and could test it that would be great.
#   
#   Signed-off-by: Hanna Linder <hannal@us.ibm.com>
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# drivers/char/agp/intel-mch-agp.c
#   2004/10/28 15:11:29-04:00 davej@redhat.com +3 -2
#   [AGPGART] intel-mch-agp.c: replace pci_find_device with pci_get_device
#   
#   As pci_find_device is going away soon I have converted this file to use
#   pci_get_device instead. I have compile tested it. If anyone has this hardware
#   and could test it that would be great.
#   
#   Signed-off-by: Hanna Linder <hannal@us.ibm.com>
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# ChangeSet
#   2004/10/28 15:10:52-04:00 davej@redhat.com 
#   [AGPGART] intel-agp.c: replace pci_find_device with pci_get_device
#   
#   As pci_find_device is going away soon I have converted this file to use
#   pci_get_device instead. I have compile tested it. If anyone has this hardware
#   and could test it that would be great.
#   
#   Signed-off-by: Hanna Linder <hannal@us.ibm.com>
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# drivers/char/agp/intel-agp.c
#   2004/10/28 15:10:46-04:00 davej@redhat.com +4 -3
#   [AGPGART] intel-agp.c: replace pci_find_device with pci_get_device
#   
#   As pci_find_device is going away soon I have converted this file to use
#   pci_get_device instead. I have compile tested it. If anyone has this hardware
#   and could test it that would be great.
#   
#   Signed-off-by: Hanna Linder <hannal@us.ibm.com>
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# ChangeSet
#   2004/10/28 15:10:07-04:00 davej@redhat.com 
#   [AGPGART] generic.c: replace pci_find_device with pci_get_device
#   
#   As pci_find_device is going away soon I have converted this file to use
#   pci_get_device instead. I have compile tested it. If anyone has this hardware
#   and could test it that would be great.
#   
#   
#   Signed-off-by: Hanna Linder <hannal@us.ibm.com>
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# drivers/char/agp/generic.c
#   2004/10/28 15:10:01-04:00 davej@redhat.com +2 -2
#   [AGPGART] generic.c: replace pci_find_device with pci_get_device
#   
#   As pci_find_device is going away soon I have converted this file to use
#   pci_get_device instead. I have compile tested it. If anyone has this hardware
#   and could test it that would be great.
#   
#   
#   Signed-off-by: Hanna Linder <hannal@us.ibm.com>
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# ChangeSet
#   2004/10/28 15:09:04-04:00 davej@redhat.com 
#   [AGPGART] amd64-agp.c replace pci_find_device with pci_get_device
#   As pci_find_device is going away soon I have converted this file to use
#   pci_get_device instead. I have compile tested it. If anyone has this hardware
#   and could test it that would be great.
#   
#   Signed-off-by: Hanna Linder <hannal@us.ibm.com>
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# drivers/char/agp/amd64-agp.c
#   2004/10/28 15:08:58-04:00 davej@redhat.com +8 -3
#   [AGPGART] amd64-agp.c replace pci_find_device with pci_get_device
#   As pci_find_device is going away soon I have converted this file to use
#   pci_get_device instead. I have compile tested it. If anyone has this hardware
#   and could test it that would be great.
#   
#   Signed-off-by: Hanna Linder <hannal@us.ibm.com>
#   Signed-off-by: Dave Jones <davej@redhat.com>
# 
# ChangeSet
#   2004/10/20 23:57:28-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/10/20 23:57:22-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/19 20:27:26-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/10/19 20:27:22-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# drivers/char/agp/intel-mch-agp.c
#   2004/10/19 20:27:22-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# drivers/char/agp/intel-agp.c
#   2004/10/19 20:27:22-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/19 16:55:15-07:00 akpm@bix.(none) 
#   Merge bk://linux-dj.bkbits.net/agpgart
#   into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/10/19 16:55:10-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/19 16:52:39-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/10/19 16:52:35-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# drivers/char/agp/intel-agp.c
#   2004/10/19 16:52:35-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/18 20:03:35-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# drivers/char/agp/intel-agp.c
#   2004/10/18 20:03:32-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/06 13:49:40-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# drivers/char/agp/intel-agp.c
#   2004/10/06 13:49:37-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/09/30 13:08:14-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/09/30 13:08:10-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/09/15 12:18:56-07:00 akpm@bix.(none) 
#   Merge bk://linux-dj.bkbits.net/agpgart
#   into bix.(none):/usr/src/bk-agpgart
# 
# drivers/char/agp/intel-mch-agp.c
#   2004/09/15 12:18:52-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# drivers/char/agp/intel-agp.c
#   2004/09/15 12:18:52-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/09/11 14:55:59-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# drivers/char/agp/intel-agp.c
#   2004/09/11 14:55:52-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/08/28 16:13:58-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/08/28 16:13:54-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/08/27 14:50:58-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/08/27 14:50:54-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/08/27 13:06:31-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/08/27 13:06:28-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/08/23 21:23:08-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# ChangeSet
#   2004/08/23 16:27:14-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# drivers/char/agp/intel-mch-agp.c
#   2004/08/23 21:23:03-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# drivers/char/agp/intel-agp.c
#   2004/08/23 21:23:03-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# include/linux/pci_ids.h
#   2004/08/23 16:27:09-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/08/23 13:42:56-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/08/23 13:42:52-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/08/22 21:03:23-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/08/22 21:03:19-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/08/05 12:39:41-07:00 akpm@bix.(none) 
#   Merge bk://linux-dj.bkbits.net/agpgart
#   into bix.(none):/usr/src/bk-agpgart
# 
# drivers/char/agp/intel-agp.c
#   2004/08/05 12:39:37-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/08/04 02:37:29-07:00 akpm@bix.(none) 
#   Merge bk://linux-dj.bkbits.net/agpgart
#   into bix.(none):/usr/src/bk-agpgart
# 
# drivers/char/agp/intel-mch-agp.c
#   2004/08/04 02:37:25-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# drivers/char/agp/intel-agp.c
#   2004/08/04 02:37:25-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/07/31 23:52:37-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/07/31 23:52:34-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/07/30 22:16:17-07:00 akpm@bix.(none) 
#   Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/07/30 22:16:14-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# drivers/char/agp/intel-agp.c
#   2004/07/30 22:16:14-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/07/27 13:18:37-07:00 akpm@bix.(none) 
#   Merge bk://linux-dj.bkbits.net/agpgart
#   into bix.(none):/usr/src/bk-agpgart
# 
# include/linux/pci_ids.h
#   2004/07/27 13:18:32-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
# drivers/char/agp/intel-agp.c
#   2004/07/27 13:18:32-07:00 akpm@bix.(none) +0 -0
#   Auto merged
# 
diff -Nru a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
--- a/drivers/char/agp/amd64-agp.c	2004-11-04 18:22:03 -08:00
+++ b/drivers/char/agp/amd64-agp.c	2004-11-04 18:22:03 -08:00
@@ -355,7 +355,7 @@
 	int i = 0;
 
 	/* cache pci_devs of northbridges. */
-	while ((loop_dev = pci_find_device(PCI_VENDOR_ID_AMD, 0x1103, loop_dev))
+	while ((loop_dev = pci_get_device(PCI_VENDOR_ID_AMD, 0x1103, loop_dev))
 			!= NULL) {
 		if (i == MAX_HAMMER_GARTS) {
 			printk(KERN_ERR PFX "Too many northbridges for AGP\n");
@@ -625,6 +625,11 @@
 int __init agp_amd64_init(void)
 {
 	int err = 0;
+	static struct pci_device_id amd64nb[] = {
+		{ PCI_DEVICE(PCI_VENDOR_ID_AMD, 0x1103) },
+		{ },
+	};
+
 	if (agp_off)
 		return -EINVAL;
 	if (pci_module_init(&agp_amd64_pci_driver) > 0) {
@@ -640,13 +645,13 @@
 		}
 
 		/* First check that we have at least one AMD64 NB */
-		if (!pci_find_device(PCI_VENDOR_ID_AMD, 0x1103, NULL))
+		if (!pci_dev_present(amd64nb))
 			return -ENODEV;
 
 		/* Look for any AGP bridge */
 		dev = NULL;
 		err = -ENODEV;
-		while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev))) {
+		for_each_pci_dev(dev) {
 			if (!pci_find_capability(dev, PCI_CAP_ID_AGP))
 				continue;
 			/* Only one bridge supported right now */
diff -Nru a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
--- a/drivers/char/agp/generic.c	2004-11-04 18:22:03 -08:00
+++ b/drivers/char/agp/generic.c	2004-11-04 18:22:03 -08:00
@@ -507,7 +507,7 @@
 	u32 tmp;
 	u32 agp3;
 
-	while ((device = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, device)) != NULL) {
+	for_each_pci_dev(device) {
 		cap_ptr = pci_find_capability(device, PCI_CAP_ID_AGP);
 		if (!cap_ptr)
 			continue;
@@ -551,7 +551,7 @@
 	if (agp_v3)
 		mode *= 4;
 
-	while ((device = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, device)) != NULL) {
+	for_each_pci_dev(device) {
 		u8 agp = pci_find_capability(device, PCI_CAP_ID_AGP);
 		if (!agp)
 			continue;
diff -Nru a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
--- a/drivers/char/agp/intel-agp.c	2004-11-04 18:22:03 -08:00
+++ b/drivers/char/agp/intel-agp.c	2004-11-04 18:22:03 -08:00
@@ -1493,7 +1493,7 @@
 {
 	struct pci_dev *i810_dev;
 
-	i810_dev = pci_find_device(PCI_VENDOR_ID_INTEL, device, NULL);
+	i810_dev = pci_get_device(PCI_VENDOR_ID_INTEL, device, NULL);
 	if (!i810_dev)
 		return 0;
 	intel_i810_private.i810_dev = i810_dev;
@@ -1504,9 +1504,9 @@
 {
 	struct pci_dev *i830_dev;
 
-	i830_dev = pci_find_device(PCI_VENDOR_ID_INTEL, device, NULL);
+	i830_dev = pci_get_device(PCI_VENDOR_ID_INTEL, device, NULL);
 	if (i830_dev && PCI_FUNC(i830_dev->devfn) != 0) {
-		i830_dev = pci_find_device(PCI_VENDOR_ID_INTEL,
+		i830_dev = pci_get_device(PCI_VENDOR_ID_INTEL,
 				device, i830_dev);
 	}
 
@@ -1715,6 +1715,7 @@
 {
 	struct agp_bridge_data *bridge = pci_get_drvdata(pdev);
 
+	pci_dev_put(pdev);
 	agp_remove_bridge(bridge);
 	agp_put_bridge(bridge);
 }
diff -Nru a/drivers/char/agp/intel-mch-agp.c b/drivers/char/agp/intel-mch-agp.c
--- a/drivers/char/agp/intel-mch-agp.c	2004-11-04 18:22:03 -08:00
+++ b/drivers/char/agp/intel-mch-agp.c	2004-11-04 18:22:03 -08:00
@@ -470,9 +470,9 @@
 {
 	struct pci_dev *i830_dev;
 
-	i830_dev = pci_find_device(PCI_VENDOR_ID_INTEL, device, NULL);
+	i830_dev = pci_get_device(PCI_VENDOR_ID_INTEL, device, NULL);
 	if (i830_dev && PCI_FUNC(i830_dev->devfn) != 0) {
-		i830_dev = pci_find_device(PCI_VENDOR_ID_INTEL,
+		i830_dev = pci_get_device(PCI_VENDOR_ID_INTEL,
 				device, i830_dev);
 	}
 
@@ -565,6 +565,7 @@
 {
 	struct agp_bridge_data *bridge = pci_get_drvdata(pdev);
 
+	pci_dev_put(pdev);
 	agp_remove_bridge(bridge);
 	agp_put_bridge(bridge);
 }
diff -Nru a/drivers/char/agp/isoch.c b/drivers/char/agp/isoch.c
--- a/drivers/char/agp/isoch.c	2004-11-04 18:22:03 -08:00
+++ b/drivers/char/agp/isoch.c	2004-11-04 18:22:03 -08:00
@@ -347,7 +347,7 @@
 	INIT_LIST_HEAD(head);
 
 	/* Find all AGP devices, and add them to dev_list. */
-	while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+	for_each_pci_dev(dev) {
 		mcapndx = pci_find_capability(dev, PCI_CAP_ID_AGP);
 		if (mcapndx == 0)
 			continue;
diff -Nru a/drivers/char/agp/sis-agp.c b/drivers/char/agp/sis-agp.c
--- a/drivers/char/agp/sis-agp.c	2004-11-04 18:22:03 -08:00
+++ b/drivers/char/agp/sis-agp.c	2004-11-04 18:22:03 -08:00
@@ -86,7 +86,7 @@
 	command |= AGPSTAT_AGP_ENABLE;
 	rate = (command & 0x7) << 2;
 
-	while ((device = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, device)) != NULL) {
+	for_each_pci_dev(device) {
 		u8 agp = pci_find_capability(device, PCI_CAP_ID_AGP);
 		if (!agp)
 			continue;