Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d48b3352 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 89c42606
Loading
Loading
Loading
Loading
+6 −5
Original line number Original line Diff line number Diff line
@@ -341,17 +341,18 @@ static int __devinit sq_sysdev_add(struct sys_device *sysdev)
{
{
	unsigned int cpu = sysdev->id;
	unsigned int cpu = sysdev->id;
	struct kobject *kobj;
	struct kobject *kobj;
	int error;


	sq_kobject[cpu] = kzalloc(sizeof(struct kobject), GFP_KERNEL);
	sq_kobject[cpu] = kzalloc(sizeof(struct kobject), GFP_KERNEL);
	if (unlikely(!sq_kobject[cpu]))
	if (unlikely(!sq_kobject[cpu]))
		return -ENOMEM;
		return -ENOMEM;


	kobj = sq_kobject[cpu];
	kobj = sq_kobject[cpu];
	kobj->parent = &sysdev->kobj;
	error = kobject_init_and_add(kobj, &ktype_percpu_entry, &sysdev->kobj,
	kobject_set_name(kobj, "%s", "sq");
				     "%s", "sq");
	kobj->ktype = &ktype_percpu_entry;
	if (!error)

		kobject_uevent(kobj, KOBJ_ADD);
	return kobject_register(kobj);
	return error;
}
}


static int __devexit sq_sysdev_remove(struct sys_device *sysdev)
static int __devexit sq_sysdev_remove(struct sys_device *sysdev)