2007-01-20 16:11:14

by Mike Frysinger

[permalink] [raw]
Subject: [patch] remove __devinit markings from rtc_sysfs_add_device()

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


Attachments:
(No filename) (839.00 B)
(No filename) (827.00 B)
linux-rtc-sysfs-no-devinit-add.patch (577.00 B)
Download all attachments

2007-01-21 10:05:05

by Alessandro Zummo

[permalink] [raw]
Subject: Re: [patch] remove __devinit markings from rtc_sysfs_add_device()

On Sat, 20 Jan 2007 11:11:02 -0500
Mike Frysinger <[email protected]> wrote:

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

thanks for spotting it!

Acked-by: Alessandro Zummo <[email protected]>


--

Best regards,

Alessandro Zummo,
Tower Technologies - Torino, Italy

http://www.towertech.it