lkml.org 
[lkml]   [2007]   [Jan]   [20]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
FromMike Frysinger <>
Subject[patch] remove __devinit markings from rtc_sysfs_add_device()
DateSat, 20 Jan 2007 11:11:02 -0500
--nextPart4779593.GnDYT6AVux
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

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

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

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

on my board, this add pointer would seemingly point into garbage because th=
e=20
memory it refers to was freed by the kernel :(
=2Dmike

--nextPart4779593.GnDYT6AVux
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.1 (GNU/Linux)
iQIVAwUARbI/F0FjO5/oN/WBAQJ3IQ/7BHMjo6pKe3X/6e3GgKJm7jae0Q6sOV4W
uIIPvLBEgYnuL6Oky0JiyoDDJ4qKqlxbwWoJ6rk8+RHMAE3w7/Sk4EfXQ9q5Vubx
7oQqph31kQ2iDF7kZc0VQ5wmiJGRydx44MwuyOWs7tFfyUf/jPpoY33ZodqVticU
cyNMZHoKcGqkrvfpFXBvGTslH8kS0FZToYiJeOdf7GkZJuSqeq9Mi3kBL1e/rHof
a0kGGc6k0bWZTeGoxH2lkyBY8AZbJ7tbOKNYNZUIPCB5ZJZiN9rHtIM8ZbA+QYe4
/cJ/F4g9tDFirNmLMbB68WANGTfo8QWmgcZXEML70bCQYdNDvHbmuo5yhTug5Aae
IE4PTGJ1yyDC1aV88TbYaOvEv+lWLG9e5b0r43HiXzh7XEY+rSjQl0uGWQl2MGp4
1lYaojPrsj6JMLvVos09B5ZhMNQ7YBAt8dIPfjQdwIcGyjHr/jMhs1OC8+4Qd8Bk
RdmOo9kyCmACgZMqEyYiCPsH5spAVSONKfIZtKCAJPlrgZN/KE9vMVyTE3nfasxq
ViH8gH867YRH41ymgb6/cvDTvbQF4iavzUwCTJtzbpZSBJXOIFpDc6faVoZGX5fA
alvXx0d8jYC0YyFTYEPmneOJQMbvqONfyNQkvq+/kDn8ugIELJ68edtcbEZ3Gyyy
qzoyNhGVCh0=
=kX4s
-----END PGP SIGNATURE-----
--nextPart4779593.GnDYT6AVux--
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;
\
 
 \ /
  Last update: 2007-01-20 17:11    [from the cache]
©2003-2008