netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 14/19] janitor: net/gt96100eth: pci_find_device to pci_get_device
@ 2005-01-11 23:10 domen
  0 siblings, 0 replies; only message in thread
From: domen @ 2005-01-11 23:10 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, domen, sfeldma, janitor




Replace pci_find_device with pci_get_device/pci_dev_put to plug
race with pci_find_device.

Signed-off-by: Scott Feldman <sfeldma@pobox.com>
Signed-off-by: Maximilian Attems <janitor@sternwelten.at>
Signed-off-by: Domen Puncer <domen@coderock.org>
---


 kj-domen/drivers/net/gt96100eth.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff -puN drivers/net/gt96100eth.c~remove-pci-find-device-drivers_net_gt96100eth drivers/net/gt96100eth.c
--- kj/drivers/net/gt96100eth.c~remove-pci-find-device-drivers_net_gt96100eth	2005-01-10 18:00:17.000000000 +0100
+++ kj-domen/drivers/net/gt96100eth.c	2005-01-10 18:00:17.000000000 +0100
@@ -615,9 +615,9 @@ static int gt96100_init_module(void)
 	/*
 	 * Stupid probe because this really isn't a PCI device
 	 */
-	if (!(pci = pci_find_device(PCI_VENDOR_ID_MARVELL,
+	if (!(pci = pci_get_device(PCI_VENDOR_ID_MARVELL,
 	                            PCI_DEVICE_ID_MARVELL_GT96100, NULL)) &&
-	    !(pci = pci_find_device(PCI_VENDOR_ID_MARVELL,
+	    !(pci = pci_get_device(PCI_VENDOR_ID_MARVELL,
 		                    PCI_DEVICE_ID_MARVELL_GT96100A, NULL))) {
 		printk(KERN_ERR __FILE__ ": GT96100 not found!\n");
 		return -ENODEV;
@@ -627,12 +627,14 @@ static int gt96100_init_module(void)
 	if (cpuConfig & (1<<12)) {
 		printk(KERN_ERR __FILE__
 		       ": must be in Big Endian mode!\n");
+		pci_dev_put(pci);
 		return -ENODEV;
 	}
 
 	for (i=0; i < NUM_INTERFACES; i++)
 		retval |= gt96100_probe1(pci, i);
 
+	pci_dev_put(pci);
 	return retval;
 }
 
_

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

only message in thread, other threads:[~2005-01-11 23:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-11 23:10 [patch 14/19] janitor: net/gt96100eth: pci_find_device to pci_get_device domen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).