diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-12-17 14:54:39 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-24 23:40:29 -0500 |
commit | d48b335256cd75fcb1a4abb3ce8136d8d9c931cc (patch) | |
tree | 301315935d06466e5a1b98e3d5a68aab8c9032f8 /arch/sh/kernel | |
parent | 89c426066462263c90957c37af29765855516b83 (diff) |
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/sh/kernel')
-rw-r--r-- | arch/sh/kernel/cpu/sh4/sq.c | 11 |
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 b22a78c807e6..97fd9b9a4820 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) | |||
341 | { | 341 | { |
342 | unsigned int cpu = sysdev->id; | 342 | unsigned int cpu = sysdev->id; |
343 | struct kobject *kobj; | 343 | struct kobject *kobj; |
344 | int error; | ||
344 | 345 | ||
345 | sq_kobject[cpu] = kzalloc(sizeof(struct kobject), GFP_KERNEL); | 346 | sq_kobject[cpu] = kzalloc(sizeof(struct kobject), GFP_KERNEL); |
346 | if (unlikely(!sq_kobject[cpu])) | 347 | if (unlikely(!sq_kobject[cpu])) |
347 | return -ENOMEM; | 348 | return -ENOMEM; |
348 | 349 | ||
349 | kobj = sq_kobject[cpu]; | 350 | kobj = sq_kobject[cpu]; |
350 | kobj->parent = &sysdev->kobj; | 351 | error = kobject_init_and_add(kobj, &ktype_percpu_entry, &sysdev->kobj, |
351 | kobject_set_name(kobj, "%s", "sq"); | 352 | "%s", "sq"); |
352 | kobj->ktype = &ktype_percpu_entry; | 353 | if (!error) |
353 | 354 | kobject_uevent(kobj, KOBJ_ADD); | |
354 | return kobject_register(kobj); | 355 | return error; |
355 | } | 356 | } |
356 | 357 | ||
357 | static int __devexit sq_sysdev_remove(struct sys_device *sysdev) | 358 | static int __devexit sq_sysdev_remove(struct sys_device *sysdev) |