lkml.org 
[lkml]   [2004]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[patch] kobject_uevent: fix init ordering
From
Date
Greg!

Looks like kobject_uevent_init is executed before netlink_proto_init and
consequently always fails. Not cool.

Attached patch switches the initialization over from core_initcall (init
level 1) to postcore_initcall (init level 2). Netlink's initialization
is done in core_initcall, so this should fix the problem. We should be
fine waiting until postcore_initcall.

Also a couple white space changes mixed in, because I am anal.

Robert Love


fix kobject_uevent init ordering

lib/kobject_uevent.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff -urN linux-2.6.10-rc1/lib/kobject_uevent.c linux/lib/kobject_uevent.c
--- linux-2.6.10-rc1/lib/kobject_uevent.c 2004-10-25 16:17:09.000000000 -0400
+++ linux/lib/kobject_uevent.c 2004-11-04 13:20:32.731836880 -0500
@@ -54,7 +54,7 @@
* gfp_mask:
*/
static int send_uevent(const char *signal, const char *obj, const void *buf,
- int buflen, int gfp_mask)
+ int buflen, int gfp_mask)
{
struct sk_buff *skb;
char *pos;
@@ -105,9 +105,8 @@
sprintf(attrpath, "%s/%s", path, attr->name);
rc = send_uevent(signal, attrpath, NULL, 0, gfp_mask);
kfree(attrpath);
- } else {
+ } else
rc = send_uevent(signal, path, NULL, 0, gfp_mask);
- }

exit:
kfree(path);
@@ -133,7 +132,6 @@
{
return do_kobject_uevent(kobj, action, attr, GFP_ATOMIC);
}
-
EXPORT_SYMBOL_GPL(kobject_uevent_atomic);

static int __init kobject_uevent_init(void)
@@ -149,7 +147,7 @@
return 0;
}

-core_initcall(kobject_uevent_init);
+postcore_initcall(kobject_uevent_init);

#else
static inline int send_uevent(const char *signal, const char *obj,

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:07    [from the cache]
©2003-2011 Jasper Spaans