summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-12-17 15:54:39 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 20:40:29 -0800
commitd48b335256cd75fcb1a4abb3ce8136d8d9c931cc (patch)
tree301315935d06466e5a1b98e3d5a68aab8c9032f8 /arch
parent89c426066462263c90957c37af29765855516b83 (diff)
downloadkernel-crypto-d48b335256cd75fcb1a4abb3ce8136d8d9c931cc.tar.gz
kernel-crypto-d48b335256cd75fcb1a4abb3ce8136d8d9c931cc.tar.xz
kernel-crypto-d48b335256cd75fcb1a4abb3ce8136d8d9c931cc.zip
Kobject: change arch/sh/kernel/cpu/sh4/sq.c to use kobject_init_and_add
Stop using kobject_register, as this way we can control the sending of the uevent properly, after everything is properly initialized. Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/kernel/cpu/sh4/sq.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c
index b22a78c807e..97fd9b9a482 100644
--- a/arch/sh/kernel/cpu/sh4/sq.c
+++ b/arch/sh/kernel/cpu/sh4/sq.c
@@ -341,17 +341,18 @@ static int __devinit sq_sysdev_add(struct sys_device *sysdev)
{
unsigned int cpu = sysdev->id;
struct kobject *kobj;
+ int error;
sq_kobject[cpu] = kzalloc(sizeof(struct kobject), GFP_KERNEL);
if (unlikely(!sq_kobject[cpu]))
return -ENOMEM;
kobj = sq_kobject[cpu];
- kobj->parent = &sysdev->kobj;
- kobject_set_name(kobj, "%s", "sq");
- kobj->ktype = &ktype_percpu_entry;
-
- return kobject_register(kobj);
+ error = kobject_init_and_add(kobj, &ktype_percpu_entry, &sysdev->kobj,
+ "%s", "sq");
+ if (!error)
+ kobject_uevent(kobj, KOBJ_ADD);
+ return error;
}
static int __devexit sq_sysdev_remove(struct sys_device *sysdev)