Skip to contentSkip to conversation

fix .text.exit error in dmfe.c

PATCH In review Paul Vojta 3 participants 3 messages Jun 26, 2002 Networking

lore
Share & tools
lore

Paul Vojta

author
#0 lore raw

PATCH 1/1 fix .text.exit error in dmfe.c

Folks:

When I compile dmfe.o statically into the 2.5.24 kernel, I get:

drivers/built-in.o(.data+0xba34): undefined reference to `local symbols in discarded section .text.exit'

The following patch seems to fix the problem:

net/tulip/dmfe.c.new renamed from net/tulip/dmfe.c +1 -1
@@ -461,7 +461,7 @@
 }
 
 
-static void __exit dmfe_remove_one (struct pci_dev *pdev)
+static void __devexit dmfe_remove_one (struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
 	struct dmfe_board_info *db = dev->priv;

I'm not (usually) a kernel hacker; I'm just mimicking what others are doing to fix similar errors. However, it is working for me right now.

--Paul Vojta, [email protected]

#1 lore raw
Quoted 21 lines · Paul Vojta

Folks:

When I compile dmfe.o statically into the 2.5.24 kernel, I get:

drivers/built-in.o(.data+0xba34): undefined reference to `local symbols in discarded section .text.exit'

The following patch seems to fix the problem:

net/tulip/dmfe.c.new renamed from net/tulip/dmfe.c +1 -1
@@ -461,7 +461,7 @@
 }
 
 
-static void __exit dmfe_remove_one (struct pci_dev *pdev)
+static void __devexit dmfe_remove_one (struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
 	struct dmfe_board_info *db = dev->priv;
Quoted 2 lines

I'm not (usually) a kernel hacker; I'm just mimicking what others are doing to fix similar errors. However, it is working for me right now.

Your patch works, but as long as tulip hasn't become a hotpluggable driver the following patch (that also fixes a similar .text.exit error in de2104x.c) should be more correct:

net/tulip/de2104x.c renamed from net/tulip/de2104x.c.old +2 -0
@@ -2216,7 +2216,9 @@
 	name:		DRV_NAME,
 	id_table:	de_pci_tbl,
 	probe:		de_init_one,
+#ifdef MODULE
 	remove:		de_remove_one,
+#endif
 #ifdef CONFIG_PM
 	suspend:	de_suspend,
 	resume:		de_resume,
net/tulip/dmfe.c renamed from net/tulip/dmfe.c.old +3 -1
@@ -1986,7 +1986,9 @@
 	name:		"dmfe",
 	id_table:	dmfe_pci_tbl,
 	probe:		dmfe_init_one,
-	remove:		__devexit_p(dmfe_remove_one),
+#ifdef MODULE
+	remove:		dmfe_remove_one,
+#endif
 };
 
 MODULE_AUTHOR("Sten Wang, [email protected]");
Quoted 1 line

--Paul Vojta, [email protected]

cu
Adrian

Signature · 3 lines
You only think this is a free country. Like the US the UK spends a lot of
time explaining its a free country because its a police state.
								Alan Cox
#2 lore raw
Quoted 4 lines · Adrian Bunk

Your patch works, but as long as tulip hasn't become a hotpluggable driver the following patch (that also fixes a similar .text.exit error in de2104x.c) should be more correct:

All pci drivers that use the pci_module_init() are now hotpluggable, due to PCI Hotplug systems :)

The devexit_p combined with __devexit solution seems to be the preferred way to handle this problem.

greg k-h