Commit 75a69ac6 authored by Samuel Ortiz's avatar Samuel Ortiz Committed by David S. Miller

[IrDA]: Fix IrDA build failure

When having built-in IrDA, we hit the following error:

`irda_sysctl_unregister' referenced in section `.init.text' of
net/built-in.o: defined in discarded section `.exit.text' of
net/built-in.o
`irda_proc_unregister' referenced in section `.init.text' of
net/built-in.o: defined in discarded section `.exit.text' of
net/built-in.o
`irsock_cleanup' referenced in section `.init.text' of net/built-in.o:
defined in discarded section `.exit.text' of net/built-in.o
`irttp_cleanup' referenced in section `.init.text' of net/built-in.o:
defined in discarded section `.exit.text' of net/built-in.o
`iriap_cleanup' referenced in section `.init.text' of net/built-in.o:
defined in discarded section `.exit.text' of net/built-in.o
`irda_device_cleanup' referenced in section `.init.text' of
net/built-in.o: defined in discarded section `.exit.text' of
net/built-in.o
`irlap_cleanup' referenced in section `.init.text' of net/built-in.o:
defined in discarded section `.exit.text' of net/built-in.o
`irlmp_cleanup' referenced in section `.init.text' of net/built-in.o:
defined in discarded section `.exit.text' of net/built-in.o
make[1]: *** [.tmp_vmlinux1] Error 1
make: *** [_all] Error 2

This is due to the irda_init fix recently added, where we call __exit
routines from an __init one. It is a build failure that I didn't catch
because it doesn't show up when building IrDA as a module. My apologies
for that.
The following patch fixes that failure and is against your net-2.6
tree. I hope it can make it to the merge window, and stable@kernel.org
is CCed on this mail.
Signed-off-by: default avatarSamuel Ortiz <samuel@sortiz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 83ca46e7
...@@ -2567,7 +2567,7 @@ int __init irsock_init(void) ...@@ -2567,7 +2567,7 @@ int __init irsock_init(void)
* Remove IrDA protocol * Remove IrDA protocol
* *
*/ */
void __exit irsock_cleanup(void) void irsock_cleanup(void)
{ {
sock_unregister(PF_IRDA); sock_unregister(PF_IRDA);
proto_unregister(&irda_proto); proto_unregister(&irda_proto);
......
...@@ -95,14 +95,14 @@ int __init irda_device_init( void) ...@@ -95,14 +95,14 @@ int __init irda_device_init( void)
return 0; return 0;
} }
static void __exit leftover_dongle(void *arg) static void leftover_dongle(void *arg)
{ {
struct dongle_reg *reg = arg; struct dongle_reg *reg = arg;
IRDA_WARNING("IrDA: Dongle type %x not unregistered\n", IRDA_WARNING("IrDA: Dongle type %x not unregistered\n",
reg->type); reg->type);
} }
void __exit irda_device_cleanup(void) void irda_device_cleanup(void)
{ {
IRDA_DEBUG(4, "%s()\n", __FUNCTION__); IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
......
...@@ -153,7 +153,7 @@ int __init iriap_init(void) ...@@ -153,7 +153,7 @@ int __init iriap_init(void)
* Initializes the IrIAP layer, called by the module cleanup code in * Initializes the IrIAP layer, called by the module cleanup code in
* irmod.c * irmod.c
*/ */
void __exit iriap_cleanup(void) void iriap_cleanup(void)
{ {
irlmp_unregister_service(service_handle); irlmp_unregister_service(service_handle);
......
...@@ -95,7 +95,7 @@ int __init irlap_init(void) ...@@ -95,7 +95,7 @@ int __init irlap_init(void)
return 0; return 0;
} }
void __exit irlap_cleanup(void) void irlap_cleanup(void)
{ {
IRDA_ASSERT(irlap != NULL, return;); IRDA_ASSERT(irlap != NULL, return;);
......
...@@ -116,7 +116,7 @@ int __init irlmp_init(void) ...@@ -116,7 +116,7 @@ int __init irlmp_init(void)
* Remove IrLMP layer * Remove IrLMP layer
* *
*/ */
void __exit irlmp_cleanup(void) void irlmp_cleanup(void)
{ {
/* Check for main structure */ /* Check for main structure */
IRDA_ASSERT(irlmp != NULL, return;); IRDA_ASSERT(irlmp != NULL, return;);
......
...@@ -84,7 +84,7 @@ void __init irda_proc_register(void) ...@@ -84,7 +84,7 @@ void __init irda_proc_register(void)
* Unregister irda entry in /proc file system * Unregister irda entry in /proc file system
* *
*/ */
void __exit irda_proc_unregister(void) void irda_proc_unregister(void)
{ {
int i; int i;
......
...@@ -287,7 +287,7 @@ int __init irda_sysctl_register(void) ...@@ -287,7 +287,7 @@ int __init irda_sysctl_register(void)
* Unregister our sysctl interface * Unregister our sysctl interface
* *
*/ */
void __exit irda_sysctl_unregister(void) void irda_sysctl_unregister(void)
{ {
unregister_sysctl_table(irda_table_header); unregister_sysctl_table(irda_table_header);
} }
......
...@@ -109,7 +109,7 @@ int __init irttp_init(void) ...@@ -109,7 +109,7 @@ int __init irttp_init(void)
* Called by module destruction/cleanup code * Called by module destruction/cleanup code
* *
*/ */
void __exit irttp_cleanup(void) void irttp_cleanup(void)
{ {
/* Check for main structure */ /* Check for main structure */
IRDA_ASSERT(irttp->magic == TTP_MAGIC, return;); IRDA_ASSERT(irttp->magic == TTP_MAGIC, return;);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment