Skip to contentSkip to conversation

gt96100: move to pci_get_device API

PATCH In review Alan Cox 2 participants 3 messages Sep 15, 2006 – Sep 16, 2006 Network drivers

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/1 gt96100: move to pci_get_device API

drivers/net/gt96100eth.c +4 -2
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.18-rc6-mm1/drivers/net/gt96100eth.c linux-2.6.18-rc6-mm1/drivers/net/gt96100eth.c
@@ -613,9 +613,9 @@
 	/*
 	 * 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;
@@ -630,6 +630,8 @@
 
 	for (i=0; i < NUM_INTERFACES; i++)
 		retval |= gt96100_probe1(pci, i);
+		
+	pci_dev_put(pci);
 
 	return retval;
 }
#1 lore raw
Quoted 6 lines · Alan Cox

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.18-rc6-mm1/drivers/net/gt96100eth.c linux-2.6.18-rc6-mm1/drivers/net/gt96100eth.c

drivers/net/gt96100eth.c line 619

Quoted 9 lines
drivers/net/gt96100eth.c +2 -2
@@ -613,9 +613,9 @@
 	/*
 	 * 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))) {

They wanted pci_device_table with for_each_pci_dev+pci_match_id here...

drivers/net/gt96100eth.c line 637

Quoted 11 lines
drivers/net/gt96100eth.c +2 -0
 		printk(KERN_ERR __FILE__ ": GT96100 not found!\n");
 		return -ENODEV;
@@ -630,6 +630,8 @@
 
 	for (i=0; i < NUM_INTERFACES; i++)
 		retval |= gt96100_probe1(pci, i);
+		
+	pci_dev_put(pci);
 
 	return retval;
 }

BTW. I posted something similar a while ago, but it wasn't applied (however, I had problems with mail-posting) See this:
http://lkml.org/lkml/2006/5/25/304
http://lkml.org/lkml/2006/6/5/268

regards,

Signature · 4 lines
http://www.fi.muni.cz/~xslaby/            Jiri Slaby
faculty of informatics, masaryk university, brno, cz
e-mail: jirislaby gmail com, gpg pubkey fingerprint:
B674 9967 0407 CE62 ACC8  22A0 32CC 55C3 39D4 7A7E
author
#2 lore raw

Ar Sad, 2006-09-16 am 14:47 +0159, ysgrifennodd Jiri Slaby:

Quoted 1 line

They wanted pci_device_table with for_each_pci_dev+pci_match_id here...

Thats a seperate problem space for this and a lot of other drivers. We need to get rid of pci_find_* more urgently than we need to make drivers support hotplug of their own hardware.

The former causes oopses walking the PCI bus tree the latter is just a limitation of drivers