linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] piix: Use refcounted interface when searching for a 450NX
@ 2006-09-15 14:14 Alan Cox
  2006-09-15 14:14 ` Sergei Shtylyov
  2006-09-15 16:54 ` Andrew Morton
  0 siblings, 2 replies; 4+ messages in thread
From: Alan Cox @ 2006-09-15 14:14 UTC (permalink / raw)
  To: akpm, linux-kernel, linux-ide

Simple conversion

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/ide/pci/piix.c linux-2.6.18-rc6-mm1/drivers/ide/pci/piix.c
--- linux.vanilla-2.6.18-rc6-mm1/drivers/ide/pci/piix.c	2006-09-11 17:00:09.000000000 +0100
+++ linux-2.6.18-rc6-mm1/drivers/ide/pci/piix.c	2006-09-14 17:19:12.000000000 +0100
@@ -602,7 +602,7 @@
 	struct pci_dev *pdev = NULL;
 	u16 cfg;
 	u8 rev;
-	while((pdev=pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, pdev))!=NULL)
+	while((pdev=pci_get_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, pdev))!=NULL)
 	{
 		/* Look for 450NX PXB. Check for problem configurations
 		   A PCI quirk checks bit 6 already */


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

* Re: [PATCH] piix: Use refcounted interface when searching for a 450NX
  2006-09-15 14:14 [PATCH] piix: Use refcounted interface when searching for a 450NX Alan Cox
@ 2006-09-15 14:14 ` Sergei Shtylyov
  2006-09-15 14:44   ` Alan Cox
  2006-09-15 16:54 ` Andrew Morton
  1 sibling, 1 reply; 4+ messages in thread
From: Sergei Shtylyov @ 2006-09-15 14:14 UTC (permalink / raw)
  To: Alan Cox; +Cc: akpm, linux-kernel, linux-ide

Hello.

Alan Cox wrote:
> Simple conversion
> 
> 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/ide/pci/piix.c linux-2.6.18-rc6-mm1/drivers/ide/pci/piix.c
> --- linux.vanilla-2.6.18-rc6-mm1/drivers/ide/pci/piix.c	2006-09-11 17:00:09.000000000 +0100
> +++ linux-2.6.18-rc6-mm1/drivers/ide/pci/piix.c	2006-09-14 17:19:12.000000000 +0100
> @@ -602,7 +602,7 @@
>  	struct pci_dev *pdev = NULL;
>  	u16 cfg;
>  	u8 rev;
> -	while((pdev=pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, pdev))!=NULL)
> +	while((pdev=pci_get_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, pdev))!=NULL)
>  	{
>  		/* Look for 450NX PXB. Check for problem configurations
>  		   A PCI quirk checks bit 6 already */

    Shouldn't pci_put_dev() be called after the bridge device no longer needed?
I assume it's not needed anymore after this function is finished...

WBR, Sergei

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

* Re: [PATCH] piix: Use refcounted interface when searching for a 450NX
  2006-09-15 14:14 ` Sergei Shtylyov
@ 2006-09-15 14:44   ` Alan Cox
  0 siblings, 0 replies; 4+ messages in thread
From: Alan Cox @ 2006-09-15 14:44 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: akpm, linux-kernel, linux-ide

Ar Gwe, 2006-09-15 am 18:14 +0400, ysgrifennodd Sergei Shtylyov:
> > -	while((pdev=pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, pdev))!=NULL)
> > +	while((pdev=pci_get_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, pdev))!=NULL)
> >  	{
> >  		/* Look for 450NX PXB. Check for problem configurations
> >  		   A PCI quirk checks bit 6 already */
> 
>     Shouldn't pci_put_dev() be called after the bridge device no longer needed?
> I assume it's not needed anymore after this function is finished...

pci_get_device gets called repeatedly to walk each device. Each call
drops the reference to the previous device (the one passed in).



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

* Re: [PATCH] piix: Use refcounted interface when searching for a 450NX
  2006-09-15 14:14 [PATCH] piix: Use refcounted interface when searching for a 450NX Alan Cox
  2006-09-15 14:14 ` Sergei Shtylyov
@ 2006-09-15 16:54 ` Andrew Morton
  1 sibling, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2006-09-15 16:54 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel, linux-ide

On Fri, 15 Sep 2006 15:14:38 +0100
Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:

> Simple conversion
> 
> 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/ide/pci/piix.c linux-2.6.18-rc6-mm1/drivers/ide/pci/piix.c
> --- linux.vanilla-2.6.18-rc6-mm1/drivers/ide/pci/piix.c	2006-09-11 17:00:09.000000000 +0100
> +++ linux-2.6.18-rc6-mm1/drivers/ide/pci/piix.c	2006-09-14 17:19:12.000000000 +0100
> @@ -602,7 +602,7 @@
>  	struct pci_dev *pdev = NULL;
>  	u16 cfg;
>  	u8 rev;
> -	while((pdev=pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, pdev))!=NULL)
> +	while((pdev=pci_get_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, pdev))!=NULL)
>  	{
>  		/* Look for 450NX PXB. Check for problem configurations
>  		   A PCI quirk checks bit 6 already */

fwiw, I have an ad450nx server upon which I occasionally test kernels.

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

end of thread, other threads:[~2006-09-15 16:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-15 14:14 [PATCH] piix: Use refcounted interface when searching for a 450NX Alan Cox
2006-09-15 14:14 ` Sergei Shtylyov
2006-09-15 14:44   ` Alan Cox
2006-09-15 16:54 ` Andrew Morton

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