Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+8 -7
+6 -5
drivers/acpi/bus.c
··· 743 743 return -ENODEV; 744 744 } 745 745 746 - decl_subsys(acpi, NULL); 746 + struct kobject *acpi_kobj; 747 747 748 748 static int __init acpi_init(void) 749 749 { ··· 755 755 return -ENODEV; 756 756 } 757 757 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 + } 762 763 763 764 result = acpi_bus_init(); 764 765
+1 -1
drivers/acpi/system.c
··· 135 135 int table_index = 0; 136 136 int result; 137 137 138 - tables_kobj.parent = &acpi_subsys.kobj; 138 + tables_kobj.parent = acpi_kobj; 139 139 kobject_set_name(&tables_kobj, "tables"); 140 140 result = kobject_register(&tables_kobj); 141 141 if (result)
+1 -1
include/acpi/acpi_bus.h
··· 319 319 u32 data; 320 320 }; 321 321 322 - extern struct kset acpi_subsys; 322 + extern struct kobject *acpi_kobj; 323 323 extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int); 324 324 /* 325 325 * External Functions