mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] s2io: Switch to pci_get_device
@ 2006-09-15 14:22 Alan Cox
  0 siblings, 0 replies; only message in thread
From: Alan Cox @ 2006-09-15 14:22 UTC (permalink / raw)
  To: raghavendra.koushik, jgarzik, linux-kernel

We want the pci devices ref counted against hotplug.

Signed-off-by: Alan Cox <alan@redhat.com>

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.18-rc6-mm1/drivers/net/s2io.c linux-2.6.18-rc6-mm1/drivers/net/s2io.c
--- linux.vanilla-2.6.18-rc6-mm1/drivers/net/s2io.c	2006-09-11 17:00:15.000000000 +0100
+++ linux-2.6.18-rc6-mm1/drivers/net/s2io.c	2006-09-14 16:46:11.000000000 +0100
@@ -855,9 +855,10 @@
 static int s2io_on_nec_bridge(struct pci_dev *s2io_pdev)
 {
 	struct pci_dev *tdev = NULL;
-	while ((tdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, tdev)) != NULL) {
-		if ((tdev->vendor == NEC_VENID) && (tdev->device == NEC_DEVID)){
+	while ((tdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, tdev)) != NULL) {
+		if (tdev->vendor == NEC_VENID && tdev->device == NEC_DEVID) {
 			if (tdev->bus == s2io_pdev->bus->parent)
+				pci_dev_put(tdev);
 				return 1;
 		}
 	}


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-09-15 14:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-15 14:22 [PATCH] s2io: Switch to pci_get_device Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome