Re: [patch] fix .text.exit error in dmfe.c

Adrian Bunk (bunk@fs.tum.de)
Wed, 26 Jun 2002 11:22:33 +0200 (CEST)


On Tue, 25 Jun 2002, Paul Vojta wrote:

> 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:
>
> --- drivers/net/tulip/dmfe.c Thu Jun 20 15:53:56 2002
> +++ drivers/net/tulip/dmfe.c.new Tue Jun 25 20:50:57 2002
> @@ -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.

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:

--- drivers/net/tulip/de2104x.c.old Sun May 12 13:55:28 2002
+++ drivers/net/tulip/de2104x.c Sun May 12 13:56:09 2002
@@ -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,
--- drivers/net/tulip/dmfe.c.old Sun May 12 13:47:59 2002
+++ drivers/net/tulip/dmfe.c Sun May 12 13:54:54 2002
@@ -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, sten_wang@davicom.com.tw");

> --Paul Vojta, vojta@math.berkeley.edu

cu
Adrian

-- 

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

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/