Skip to content

Commit 99e0d2f

Browse files
committed
kobject: convert /sys/firmware/acpi/ to use kobject_create
We don't need a kset here, a simple kobject will do just fine, so dynamically create the kobject and use it. Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Len Brown <lenb@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 9651d35 commit 99e0d2f

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

‎drivers/acpi/bus.c‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ static int __init acpi_bus_init(void)
743743
return -ENODEV;
744744
}
745745

746-
decl_subsys(acpi, NULL);
746+
struct kobject *acpi_kobj;
747747

748748
static int __init acpi_init(void)
749749
{
@@ -755,10 +755,11 @@ static int __init acpi_init(void)
755755
return -ENODEV;
756756
}
757757

758-
result = firmware_register(&acpi_subsys);
759-
if (result < 0)
760-
printk(KERN_WARNING "%s: firmware_register error: %d\n",
761-
__FUNCTION__, result);
758+
acpi_kobj = kobject_create_and_add("acpi", &firmware_kset->kobj);
759+
if (!acpi_kobj) {
760+
printk(KERN_WARNING "%s: kset create error\n", __FUNCTION__);
761+
acpi_kobj = NULL;
762+
}
762763

763764
result = acpi_bus_init();
764765

‎drivers/acpi/system.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static int acpi_system_sysfs_init(void)
135135
int table_index = 0;
136136
int result;
137137

138-
tables_kobj.parent = &acpi_subsys.kobj;
138+
tables_kobj.parent = acpi_kobj;
139139
kobject_set_name(&tables_kobj, "tables");
140140
result = kobject_register(&tables_kobj);
141141
if (result)

‎include/acpi/acpi_bus.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ struct acpi_bus_event {
319319
u32 data;
320320
};
321321

322-
extern struct kset acpi_subsys;
322+
extern struct kobject *acpi_kobj;
323323
extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int);
324324
/*
325325
* External Functions

0 commit comments

Comments
 (0)