[PATCH 17/27] acer-wmi: fix section mismatch warnings

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: LKML <linux-kernel@...>, Andrew Morton <akpm@...>
Cc: Sam Ravnborg <sam@...>, Carlos Corbacho <carlos@...>, Len Brown <len.brown@...>
Date: Sunday, February 17, 2008 - 8:22 am

Fix following warnings:
WARNING: vmlinux.o(.text+0x672615): Section mismatch in reference from the function acer_platform_remove() to the function .exit.text:acer_backlight_exit()
WARNING: vmlinux.o(.devinit.text+0x1e859): Section mismatch in reference from the function acer_platform_probe() to the function .init.text:acer_led_init()
WARNING: vmlinux.o(.devinit.text+0x1e878): Section mismatch in reference from the function acer_platform_probe() to the function .init.text:acer_backlight_init()

Remove __exit annotation from acer_backlight_exit(). We cannot reference
a __exit annotated function from non __exit functions.

acer_led_init() and acer_backlight_init() where both annotated __init but
used from a __devinit function. This would result in an oops should
gcc drop their inlining and the module are hot plugged.

Fix by annotating acer_led_init() and acer_backlight_init() __devinit.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Len Brown <len.brown@intel.com>
---
 drivers/misc/acer-wmi.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/acer-wmi.c b/drivers/misc/acer-wmi.c
index d7aea93..cdc733b 100644
--- a/drivers/misc/acer-wmi.c
+++ b/drivers/misc/acer-wmi.c
@@ -756,7 +756,7 @@ static struct led_classdev mail_led = {
 	.brightness_set = mail_led_set,
 };
 
-static int __init acer_led_init(struct device *dev)
+static int __devinit acer_led_init(struct device *dev)
 {
 	return led_classdev_register(dev, &mail_led);
 }
@@ -789,7 +789,7 @@ static struct backlight_ops acer_bl_ops = {
 	.update_status = update_bl_status,
 };
 
-static int __init acer_backlight_init(struct device *dev)
+static int __devinit acer_backlight_init(struct device *dev)
 {
 	struct backlight_device *bd;
 
@@ -808,7 +808,7 @@ static int __init acer_backlight_init(struct device *dev)
 	return 0;
 }
 
-static void __exit acer_backlight_exit(void)
+static void acer_backlight_exit(void)
 {
 	backlight_device_unregister(acer_backlight_device);
 }
-- 
1.5.4.rc3.14.g44397

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/27] fix section mismatches, Sam Ravnborg, (Sun Feb 17, 8:12 am)
[PATCH 17/27] acer-wmi: fix section mismatch warnings, Sam Ravnborg, (Sun Feb 17, 8:22 am)
Re: [PATCH 17/27] acer-wmi: fix section mismatch warnings, Carlos Corbacho, (Sun Feb 17, 9:03 am)
Re: [PATCH 17/27] acer-wmi: fix section mismatch warnings, Sam Ravnborg, (Sun Feb 17, 11:05 am)
[PATCH 16/27] scsi: fix section mismatch in aic94xx, Sam Ravnborg, (Sun Feb 17, 8:22 am)
[PATCH 15/27] cpufreq: fix section mismatch warnings, Sam Ravnborg, (Sun Feb 17, 8:22 am)
[PATCH 24/27] pcmcia: annotate cb_alloc with __ref, Sam Ravnborg, (Sun Feb 17, 8:23 am)
[PATCH 14/27] hwmon: fix section mismatch in coretemp, Sam Ravnborg, (Sun Feb 17, 8:22 am)
Re: [PATCH 14/27] hwmon: fix section mismatch in coretemp, Mark M. Hoffman, (Sun Feb 17, 1:07 pm)
[PATCH 19/27] tpm: fix section mismatch warning, Sam Ravnborg, (Sun Feb 17, 8:22 am)