Skip to contentSkip to conversation

fix tlan.c for !PCI

PATCH Jeff Garzik 2 participants 2 messages May 15, 2004 – May 16, 2004 1 message not in the archive Network drivers

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 21 lines · Linux Kernel Mailing List

ChangeSet 1.1691, 2004/05/15 10:23:43-07:00, [email protected]

[PATCH] fix tlan.c for !PCI

From: Adrian Bunk <[email protected]>

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

drivers/net/tlan.c line 451

Quoted 6 lines
drivers/net/tlan.c +2 -0
@@ -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

#2 lore raw
Quoted 36 lines · Jeff Garzik
Quoted 24 lines · Linux Kernel Mailing List

ChangeSet 1.1691, 2004/05/15 10:23:43-07:00, [email protected]

[PATCH] fix tlan.c for !PCI

From: Adrian Bunk <[email protected]>

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

drivers/net/tlan.c line 452

Quoted 7 lines
drivers/net/tlan.c +2 -0
@@ -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.

Quoted 5 lines

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.

Quoted 3 lines

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

drivers/net/tlan.c renamed from drivers/net/tlan.c.old +6 -0
@@ -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);