From: Mike Frysinger <vapier@gentoo.org>
To: a.zummo@towertech.it
Cc: linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com
Subject: [patch] remove __devinit markings from rtc_sysfs_add_device()
Date: Sat, 20 Jan 2007 11:11:02 -0500 [thread overview]
Message-ID: <200701201111.03507.vapier@gentoo.org> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 856 bytes --]
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 #1.2: Type: application/pgp-signature, Size: 827 bytes --]
[-- Attachment #2: linux-rtc-sysfs-no-devinit-add.patch --]
[-- Type: text/x-diff, Size: 577 bytes --]
rtc_sysfs_add_device is needed even after dev initialization, so drop __devinit.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
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;
next reply other threads:[~2007-01-20 16:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-20 16:11 Mike Frysinger [this message]
2007-01-21 10:04 ` [patch] remove __devinit markings from rtc_sysfs_add_device() Alessandro Zummo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200701201111.03507.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=a.zummo@towertech.it \
--cc=linux-kernel@vger.kernel.org \
--cc=rtc-linux@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox