[patch] remove __devinit markings from rtc_sysfs_add_device()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



the sysfs interface from the rtc framework seems to incorrectly label the add 
function with __devinit ... the proc and dev interfaces do not have this 
label on their add functions

ive been trying to develop a rtc module and it kept crashing ... after 
debugging it, i'm pretty sure ive traced it back to the devinit markings ... 
dropping this lets my module load nicely :)

the crash would happen after my rtc called rtc_device_register ... down in 
class_device_add in drivers/base/class.c, the active class interface list is 
walked and the add function is checked ... if it's non-null (aka in some 
interface would like to be notified of additions), then it's called with the 
new device information

on my board, this add pointer would seemingly point into garbage because the 
memory it refers to was freed by the kernel :(
-mike

Attachment: pgpYp3d9AMIPL.pgp
Description: PGP signature

rtc_sysfs_add_device is needed even after dev initialization, so drop __devinit.

Signed-off-by: Mike Frysinger <[email protected]>

diff --git a/drivers/rtc/rtc-sysfs.c b/drivers/rtc/rtc-sysfs.c
index 9418a59..2ddd0cf 100644
--- a/drivers/rtc/rtc-sysfs.c
+++ b/drivers/rtc/rtc-sysfs.c
@@ -78,7 +78,7 @@ static struct attribute_group rtc_attr_group = {
 	.attrs = rtc_attrs,
 };
 
-static int __devinit rtc_sysfs_add_device(struct class_device *class_dev,
+static int rtc_sysfs_add_device(struct class_device *class_dev,
 					struct class_interface *class_intf)
 {
 	int err;

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux