aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLee, Chun-Yi <joeyli.kernel@gmail.com>2012-10-05 01:54:56 -0400
committerMatt Fleming <matt.fleming@intel.com>2012-10-30 06:39:18 -0400
commit605e70c7aa1b7b0d554baf945630c1d606bbfbc3 (patch)
tree69982941955577654db2bd42ecd5235230407a7a /drivers
parent0c542edde3cecc99b180a440ae33dcb7f28642ce (diff)
efi: add efivars kobject to efi sysfs folder
UEFI variable filesystem need a new mount point, so this patch add efivars kobject to efi_kobj for create a /sys/firmware/efi/efivars folder. Cc: Matthew Garrett <mjg@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Lee, Chun-Yi <jlee@suse.com> Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firmware/efivars.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index d7658b4a5010..6793965b7c8b 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -1527,6 +1527,7 @@ void unregister_efivars(struct efivars *efivars)
1527 sysfs_remove_bin_file(&efivars->kset->kobj, efivars->del_var); 1527 sysfs_remove_bin_file(&efivars->kset->kobj, efivars->del_var);
1528 kfree(efivars->new_var); 1528 kfree(efivars->new_var);
1529 kfree(efivars->del_var); 1529 kfree(efivars->del_var);
1530 kobject_put(efivars->kobject);
1530 kset_unregister(efivars->kset); 1531 kset_unregister(efivars->kset);
1531} 1532}
1532EXPORT_SYMBOL_GPL(unregister_efivars); 1533EXPORT_SYMBOL_GPL(unregister_efivars);
@@ -1558,6 +1559,14 @@ int register_efivars(struct efivars *efivars,
1558 goto out; 1559 goto out;
1559 } 1560 }
1560 1561
1562 efivars->kobject = kobject_create_and_add("efivars", parent_kobj);
1563 if (!efivars->kobject) {
1564 pr_err("efivars: Subsystem registration failed.\n");
1565 error = -ENOMEM;
1566 kset_unregister(efivars->kset);
1567 goto out;
1568 }
1569
1561 /* 1570 /*
1562 * Per EFI spec, the maximum storage allocated for both 1571 * Per EFI spec, the maximum storage allocated for both
1563 * the variable name and variable data is 1024 bytes. 1572 * the variable name and variable data is 1024 bytes.