LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Re: [PATCH] fix tlan.c for !PCI
       [not found] <200405151823.i4FINj8T001262@hera.kernel.org>
@ 2004-05-15 18:53 ` Jeff Garzik
  2004-05-16  0:21   ` Adrian Bunk
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Garzik @ 2004-05-15 18:53 UTC (permalink / raw)
  To: akpm, bunk; +Cc: Linux Kernel Mailing List

Linux Kernel Mailing List wrote:
> ChangeSet 1.1691, 2004/05/15 10:23:43-07:00, akpm@osdl.org
> 
> 	[PATCH] fix tlan.c for !PCI
> 	
> 	From: Adrian Bunk <bunk@fs.tum.de>
> 	
> 	drivers/net/tlan.c: In function `tlan_remove_one':
> 	drivers/net/tlan.c:449: warning: implicit declaration of function `pci_release_regions'
> 
> 
> # This patch includes the following deltas:
> #	           ChangeSet	1.1690  -> 1.1691 
> #	  drivers/net/tlan.c	1.31    -> 1.32   
> #
> 
>  tlan.c |    4 ++++
>  1 files changed, 4 insertions(+)
> 
> 
> diff -Nru a/drivers/net/tlan.c b/drivers/net/tlan.c
> --- a/drivers/net/tlan.c	Sat May 15 11:23:50 2004
> +++ b/drivers/net/tlan.c	Sat May 15 11:23:50 2004
> @@ -446,7 +446,9 @@
>  		pci_free_consistent(priv->pciDev, priv->dmaSize, priv->dmaStorage, priv->dmaStorageDMA );
>  	}
>  
> +#ifdef CONFIG_PCI
>  	pci_release_regions(pdev);
> +#endif


Ug.  Please revert and fix it the right way.

Think about this one:  we are getting the warning inside a function that 
will only ever be called when CONFIG_PCI is defined, the PCI ->remove hook.

IMO one of two things needs to happen:
a) wrap the PCI probe functions in tlan.c with CONFIG_PCI
	or
b) create the proper wrapper in include/linux/pci.h, following 
established practice in that header



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

* Re: [PATCH] fix tlan.c for !PCI
  2004-05-15 18:53 ` [PATCH] fix tlan.c for !PCI Jeff Garzik
@ 2004-05-16  0:21   ` Adrian Bunk
  0 siblings, 0 replies; 2+ messages in thread
From: Adrian Bunk @ 2004-05-16  0:21 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: akpm, Linux Kernel Mailing List, Samuel S Chessman

On Sat, May 15, 2004 at 02:53:03PM -0400, Jeff Garzik wrote:
> Linux Kernel Mailing List wrote:
> >ChangeSet 1.1691, 2004/05/15 10:23:43-07:00, akpm@osdl.org
> >
> >	[PATCH] fix tlan.c for !PCI
> >	
> >	From: Adrian Bunk <bunk@fs.tum.de>
> >	
> >	drivers/net/tlan.c: In function `tlan_remove_one':
> >	drivers/net/tlan.c:449: warning: implicit declaration of function 
> >	`pci_release_regions'
> >
> >
> ># This patch includes the following deltas:
> >#	           ChangeSet	1.1690  -> 1.1691 
> >#	  drivers/net/tlan.c	1.31    -> 1.32   
> >#
> >
> > tlan.c |    4 ++++
> > 1 files changed, 4 insertions(+)
> >
> >
> >diff -Nru a/drivers/net/tlan.c b/drivers/net/tlan.c
> >--- a/drivers/net/tlan.c	Sat May 15 11:23:50 2004
> >+++ b/drivers/net/tlan.c	Sat May 15 11:23:50 2004
> >@@ -446,7 +446,9 @@
> > 		pci_free_consistent(priv->pciDev, priv->dmaSize, 
> > 		priv->dmaStorage, priv->dmaStorageDMA );
> > 	}
> > 
> >+#ifdef CONFIG_PCI
> > 	pci_release_regions(pdev);
> >+#endif
> 
> 
> Ug.  Please revert and fix it the right way.
> 
> Think about this one:  we are getting the warning inside a function that 
> will only ever be called when CONFIG_PCI is defined, the PCI ->remove hook.
> 
> IMO one of two things needs to happen:
> a) wrap the PCI probe functions in tlan.c with CONFIG_PCI

Updated patch below.

> 	or
> b) create the proper wrapper in include/linux/pci.h, following 
> established practice in that header

  http://www.ussg.iu.edu/hypermail/linux/kernel/0405.1/1204.html

cu
Adrian


--- linux-2.6.6-mm2-full/drivers/net/tlan.c.old	2004-05-16 02:09:52.000000000 +0200
+++ linux-2.6.6-mm2-full/drivers/net/tlan.c	2004-05-16 02:13:47.000000000 +0200
@@ -435,6 +435,7 @@
 	 **************************************************************/
 
 
+#ifdef CONFIG_PCI
 static void __devexit tlan_remove_one( struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata( pdev );
@@ -452,12 +453,15 @@
 		
 	pci_set_drvdata( pdev, NULL );
 } 
+#endif
 
 static struct pci_driver tlan_driver = {
 	.name		= "tlan",
 	.id_table	= tlan_pci_tbl,
 	.probe		= tlan_init_one,
+#ifdef CONFIG_PCI
 	.remove		= __devexit_p(tlan_remove_one),	
+#endif
 };
 
 static int __init tlan_probe(void)
@@ -673,8 +677,10 @@
 err_out_free_dev:
 	free_netdev(dev);
 err_out_regions:
+#ifdef CONFIG_PCI
 	if (pdev)
 		pci_release_regions(pdev);
+#endif
 err_out:
 	if (pdev)
 		pci_disable_device(pdev);

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

end of thread, other threads:[~2004-05-16  0:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200405151823.i4FINj8T001262@hera.kernel.org>
2004-05-15 18:53 ` [PATCH] fix tlan.c for !PCI Jeff Garzik
2004-05-16  0:21   ` Adrian Bunk

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