summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/system.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-12-17 20:54:39 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-25 05:40:28 +0100
commita77aa28a2db3d134dd387f0f05cd6b6717fb1d28 (patch)
tree3d30e7f284338a6c99a2c1ee119bf992d3808f5e /drivers/acpi/system.c
parentKobject: change arch/x86/kernel/cpu/intel_cacheinfo.c to use kobject_init_and... (diff)
downloadlinux-a77aa28a2db3d134dd387f0f05cd6b6717fb1d28.tar.xz
linux-a77aa28a2db3d134dd387f0f05cd6b6717fb1d28.zip
Kobject: change drivers/acpi/system.c to use kobject_create_and_add
Stop using kobject_register for this static kobject, as it's overkill. This way is much simpler. Cc: Len Brown <len.brown@intel.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/acpi/system.c')
-rw-r--r--drivers/acpi/system.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c
index c22b93aab7fe..5ffe0ea18967 100644
--- a/drivers/acpi/system.c
+++ b/drivers/acpi/system.c
@@ -58,7 +58,7 @@ module_param_call(acpica_version, NULL, param_get_acpica_version, NULL, 0444);
FS Interface (/sys)
-------------------------------------------------------------------------- */
static LIST_HEAD(acpi_table_attr_list);
-static struct kobject tables_kobj;
+static struct kobject *tables_kobj;
struct acpi_table_attr {
struct bin_attribute attr;
@@ -135,11 +135,9 @@ static int acpi_system_sysfs_init(void)
int table_index = 0;
int result;
- tables_kobj.parent = acpi_kobj;
- kobject_set_name(&tables_kobj, "tables");
- result = kobject_register(&tables_kobj);
- if (result)
- return result;
+ tables_kobj = kobject_create_and_add("tables", acpi_kobj);
+ if (!tables_kobj)
+ return -ENOMEM;
do {
result = acpi_get_table_by_index(table_index, &table_header);
@@ -153,7 +151,7 @@ static int acpi_system_sysfs_init(void)
acpi_table_attr_init(table_attr, table_header);
result =
- sysfs_create_bin_file(&tables_kobj,
+ sysfs_create_bin_file(tables_kobj,
&table_attr->attr);
if (result) {
kfree(table_attr);
@@ -163,6 +161,7 @@ static int acpi_system_sysfs_init(void)
&acpi_table_attr_list);
}
} while (!result);
+ kobject_uevent(tables_kobj, KOBJ_ADD);
return 0;
}