netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gt96100: stop using pci_find_device()
@ 2005-09-14 18:51 Alexey Dobriyan
  2005-09-14 19:00 ` Jeff Garzik
  2005-09-14 19:40 ` Ralf Baechle
  0 siblings, 2 replies; 3+ messages in thread
From: Alexey Dobriyan @ 2005-09-14 18:51 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Scott Feldman, netdev, linux-mips

From: Scott Feldman <sfeldma@pobox.com>

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>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

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

--- a/drivers/net/gt96100eth.c
+++ b/drivers/net/gt96100eth.c
@@ -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] 3+ messages in thread

* Re: [PATCH] gt96100: stop using pci_find_device()
  2005-09-14 18:51 [PATCH] gt96100: stop using pci_find_device() Alexey Dobriyan
@ 2005-09-14 19:00 ` Jeff Garzik
  2005-09-14 19:40 ` Ralf Baechle
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2005-09-14 19:00 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: Ralf Baechle, Scott Feldman, netdev, linux-mips

Alexey Dobriyan wrote:
> From: Scott Feldman <sfeldma@pobox.com>
> 
> 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>
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---
> 
>  drivers/net/gt96100eth.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> --- a/drivers/net/gt96100eth.c
> +++ b/drivers/net/gt96100eth.c
> @@ -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;

NAK -- convert it to use standard PCI driver API.

	Jeff

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gt96100: stop using pci_find_device()
  2005-09-14 18:51 [PATCH] gt96100: stop using pci_find_device() Alexey Dobriyan
  2005-09-14 19:00 ` Jeff Garzik
@ 2005-09-14 19:40 ` Ralf Baechle
  1 sibling, 0 replies; 3+ messages in thread
From: Ralf Baechle @ 2005-09-14 19:40 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: Scott Feldman, netdev, linux-mips

On Wed, Sep 14, 2005 at 10:51:37PM +0400, Alexey Dobriyan wrote:

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

The system is a little odd; the race condition probably doens't exist on
this particular chipset.

  Ralf

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-09-14 19:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-14 18:51 [PATCH] gt96100: stop using pci_find_device() Alexey Dobriyan
2005-09-14 19:00 ` Jeff Garzik
2005-09-14 19:40 ` Ralf Baechle

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).