From: Greg Kroah-Hartman Date: Mon, 17 Dec 2007 19:54:39 +0000 (-0400) Subject: Kobject: change drivers/firmware/edd.c to use kobject_init_and_add X-Git-Tag: v3.12-rc1~24134^2~85 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dd002e807486f9858147c073069a37ba625baad8;p=kernel%2Fkernel-generic.git Kobject: change drivers/firmware/edd.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: Matt Domsch Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c index ddcc957..dc0b87b 100644 --- a/drivers/firmware/edd.c +++ b/drivers/firmware/edd.c @@ -721,13 +721,13 @@ edd_device_register(struct edd_device *edev, int i) if (!edev) return 1; edd_dev_set_info(edev, i); - kobject_set_name(&edev->kobj, "int13_dev%02x", - 0x80 + i); edev->kobj.kset = edd_kset; - edev->kobj.ktype = &edd_ktype; - error = kobject_register(&edev->kobj); - if (!error) + error = kobject_init_and_add(&edev->kobj, &edd_ktype, NULL, + "int13_dev%02x", 0x80 + i); + if (!error) { edd_populate_dir(edev); + kobject_uevent(&edev->kobj, KOBJ_ADD); + } return error; }