linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] Fix .text.exit error with static compile of synclinkmp.c
@ 2002-09-05 17:36 Adrian Bunk
  2002-09-05 17:43 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Bunk @ 2002-09-05 17:36 UTC (permalink / raw)
  To: Marcelo Tosatti, paulkf; +Cc: linux-kernel

Hi,

when compiling synclinkmp.c statically into the kernel the following error
occurs at the final linking (this is 2.4.20-pre5-ac2 but the problem also
exists in 2.4.20-pre5):

<--  snip  -->

...
        --end-group \
        -o vmlinux
drivers/char/char.o(.data+0x81b4): undefined reference to `local symbols
in discarded section .text.exit'
make: *** [vmlinux] Error 1

<--  snip  -->

The problem is that the __exit function synclinkmp_remove_one is referred
to in "static struct pci_driver synclinkmp_pci_driver".

The fix is simple:

--- drivers/char/synclinkmp.c.old	2002-09-05 12:40:25.000000000 +0200
+++ drivers/char/synclinkmp.c	2002-09-05 12:42:34.000000000 +0200
@@ -519,7 +519,9 @@
 	name:		"synclinkmp",
 	id_table:	synclinkmp_pci_tbl,
 	probe:		synclinkmp_init_one,
+#ifdef MODULE
 	remove:		synclinkmp_remove_one,
+#endif
 };



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


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

* Re: [patch] Fix .text.exit error with static compile of synclinkmp.c
  2002-09-05 17:36 [patch] Fix .text.exit error with static compile of synclinkmp.c Adrian Bunk
@ 2002-09-05 17:43 ` Christoph Hellwig
  2002-09-05 20:11   ` Adrian Bunk
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2002-09-05 17:43 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Marcelo Tosatti, paulkf, linux-kernel

> The problem is that the __exit function synclinkmp_remove_one is referred
> to in "static struct pci_driver synclinkmp_pci_driver".
> 
> The fix is simple:

And wrong.  Please use __devexit_p() instead.


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

* Re: [patch] Fix .text.exit error with static compile of synclinkmp.c
  2002-09-05 17:43 ` Christoph Hellwig
@ 2002-09-05 20:11   ` Adrian Bunk
  2002-09-05 20:15     ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Bunk @ 2002-09-05 20:11 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Marcelo Tosatti, paulkf, linux-kernel

On Thu, 5 Sep 2002, Christoph Hellwig wrote:

> > The problem is that the __exit function synclinkmp_remove_one is referred
> > to in "static struct pci_driver synclinkmp_pci_driver".
> >
> > The fix is simple:
>
> And wrong.  Please use __devexit_p() instead.


Yes, that sounds like a better idea. What about the following patch?


--- drivers/char/synclinkmp.c.old	2002-09-05 21:29:11.000000000 +0200
+++ drivers/char/synclinkmp.c	2002-09-05 21:33:32.000000000 +0200
@@ -506,8 +506,8 @@
 static char *driver_name = "SyncLink MultiPort driver";
 static char *driver_version = "$Revision: 3.17 $";

-static int __init synclinkmp_init_one(struct pci_dev *dev,const struct pci_device_id *ent);
-static void __exit synclinkmp_remove_one(struct pci_dev *dev);
+static int __devinit synclinkmp_init_one(struct pci_dev *dev,const struct pci_device_id *ent);
+static void __devexit synclinkmp_remove_one(struct pci_dev *dev);

 static struct pci_device_id synclinkmp_pci_tbl[] __devinitdata = {
 	{ PCI_VENDOR_ID_MICROGATE, PCI_DEVICE_ID_MICROGATE_SCA, PCI_ANY_ID, PCI_ANY_ID, },
@@ -519,7 +519,7 @@
 	name:		"synclinkmp",
 	id_table:	synclinkmp_pci_tbl,
 	probe:		synclinkmp_init_one,
-	remove:		synclinkmp_remove_one,
+	remove:		__devexit_p(synclinkmp_remove_one),
 };


@@ -5595,8 +5595,8 @@
 }


-static int __init synclinkmp_init_one (struct pci_dev *dev,
-				       const struct pci_device_id *ent)
+static int __devinit synclinkmp_init_one (struct pci_dev *dev,
+				          const struct pci_device_id *ent)
 {
 	if (pci_enable_device(dev)) {
 		printk("error enabling pci device %p\n", dev);
@@ -5606,6 +5606,6 @@
 	return 0;
 }

-static void __exit synclinkmp_remove_one (struct pci_dev *dev)
+static void __devexit synclinkmp_remove_one (struct pci_dev *dev)
 {
 }

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



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

* Re: [patch] Fix .text.exit error with static compile of synclinkmp.c
  2002-09-05 20:11   ` Adrian Bunk
@ 2002-09-05 20:15     ` Christoph Hellwig
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2002-09-05 20:15 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Marcelo Tosatti, paulkf, linux-kernel

On Thu, Sep 05, 2002 at 10:11:27PM +0200, Adrian Bunk wrote:
> Yes, that sounds like a better idea. What about the following patch?

Looks good to me.


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

end of thread, other threads:[~2002-09-05 20:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-05 17:36 [patch] Fix .text.exit error with static compile of synclinkmp.c Adrian Bunk
2002-09-05 17:43 ` Christoph Hellwig
2002-09-05 20:11   ` Adrian Bunk
2002-09-05 20:15     ` Christoph Hellwig

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