Commit d6d292c4 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Kobject: change drivers/firmware/efivars.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 <Matt_Domsch@dell.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent dd002e80
...@@ -617,16 +617,16 @@ efivar_create_sysfs_entry(unsigned long variable_name_size, ...@@ -617,16 +617,16 @@ efivar_create_sysfs_entry(unsigned long variable_name_size,
*(short_name + strlen(short_name)) = '-'; *(short_name + strlen(short_name)) = '-';
efi_guid_unparse(vendor_guid, short_name + strlen(short_name)); efi_guid_unparse(vendor_guid, short_name + strlen(short_name));
kobject_set_name(&new_efivar->kobj, "%s", short_name);
new_efivar->kobj.kset = vars_kset; new_efivar->kobj.kset = vars_kset;
new_efivar->kobj.ktype = &efivar_ktype; i = kobject_init_and_add(&new_efivar->kobj, &efivar_ktype, NULL,
i = kobject_register(&new_efivar->kobj); "%s", short_name);
if (i) { if (i) {
kfree(short_name); kfree(short_name);
kfree(new_efivar); kfree(new_efivar);
return 1; return 1;
} }
kobject_uevent(&new_efivar->kobj, KOBJ_ADD);
kfree(short_name); kfree(short_name);
short_name = NULL; short_name = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment