diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-12-17 14:54:39 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-24 23:40:28 -0500 |
commit | a77aa28a2db3d134dd387f0f05cd6b6717fb1d28 (patch) | |
tree | 3d30e7f284338a6c99a2c1ee119bf992d3808f5e /drivers/acpi | |
parent | 5b3f355d8fef95901505e924818b3031092453c2 (diff) |
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')
-rw-r--r-- | drivers/acpi/system.c | 13 |
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); | |||
58 | FS Interface (/sys) | 58 | FS Interface (/sys) |
59 | -------------------------------------------------------------------------- */ | 59 | -------------------------------------------------------------------------- */ |
60 | static LIST_HEAD(acpi_table_attr_list); | 60 | static LIST_HEAD(acpi_table_attr_list); |
61 | static struct kobject tables_kobj; | 61 | static struct kobject *tables_kobj; |
62 | 62 | ||
63 | struct acpi_table_attr { | 63 | struct acpi_table_attr { |
64 | struct bin_attribute attr; | 64 | struct bin_attribute attr; |
@@ -135,11 +135,9 @@ static int acpi_system_sysfs_init(void) | |||
135 | int table_index = 0; | 135 | int table_index = 0; |
136 | int result; | 136 | int result; |
137 | 137 | ||
138 | tables_kobj.parent = acpi_kobj; | 138 | tables_kobj = kobject_create_and_add("tables", acpi_kobj); |
139 | kobject_set_name(&tables_kobj, "tables"); | 139 | if (!tables_kobj) |
140 | result = kobject_register(&tables_kobj); | 140 | return -ENOMEM; |
141 | if (result) | ||
142 | return result; | ||
143 | 141 | ||
144 | do { | 142 | do { |
145 | result = acpi_get_table_by_index(table_index, &table_header); | 143 | result = acpi_get_table_by_index(table_index, &table_header); |
@@ -153,7 +151,7 @@ static int acpi_system_sysfs_init(void) | |||
153 | 151 | ||
154 | acpi_table_attr_init(table_attr, table_header); | 152 | acpi_table_attr_init(table_attr, table_header); |
155 | result = | 153 | result = |
156 | sysfs_create_bin_file(&tables_kobj, | 154 | sysfs_create_bin_file(tables_kobj, |
157 | &table_attr->attr); | 155 | &table_attr->attr); |
158 | if (result) { | 156 | if (result) { |
159 | kfree(table_attr); | 157 | kfree(table_attr); |
@@ -163,6 +161,7 @@ static int acpi_system_sysfs_init(void) | |||
163 | &acpi_table_attr_list); | 161 | &acpi_table_attr_list); |
164 | } | 162 | } |
165 | } while (!result); | 163 | } while (!result); |
164 | kobject_uevent(tables_kobj, KOBJ_ADD); | ||
166 | 165 | ||
167 | return 0; | 166 | return 0; |
168 | } | 167 | } |