[PATCH 51/54] kset: convert acpi to use kset_create

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dynamically create the kset instead of declaring it statically.

Cc: Kay Sievers <[email protected]>
Cc: Len Brown <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 drivers/acpi/bus.c      |   12 ++++++++----
 drivers/acpi/system.c   |    2 +-
 include/acpi/acpi_bus.h |    2 +-
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index fe90513..8be7567 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -744,7 +744,7 @@ static int __init acpi_bus_init(void)
 	return -ENODEV;
 }
 
-decl_subsys(acpi, NULL);
+struct kset *acpi_kset;
 
 static int __init acpi_init(void)
 {
@@ -756,10 +756,14 @@ static int __init acpi_init(void)
 		return -ENODEV;
 	}
 
-	result = firmware_register(&acpi_subsys);
-	if (result < 0)
-		printk(KERN_WARNING "%s: firmware_register error: %d\n",
+	acpi_kset = kset_create_and_register("acpi", NULL, NULL,
+					     firmware_kset);
+	if (IS_ERR(acpi_kset)) {
+		result = PTR_ERR(acpi_kset);
+		printk(KERN_WARNING "%s: kset create error: %d\n",
 			__FUNCTION__, result);
+		acpi_kset = NULL;
+	}
 
 	result = acpi_bus_init();
 
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c
index edee280..a9eb14c 100644
--- a/drivers/acpi/system.c
+++ b/drivers/acpi/system.c
@@ -135,7 +135,7 @@ static int acpi_system_sysfs_init(void)
 	int table_index = 0;
 	int result;
 
-	tables_kobj.parent = &acpi_subsys.kobj;
+	tables_kobj.parent = &acpi_kset->kobj;
 	kobject_set_name(&tables_kobj, "tables");
 	result = kobject_register(&tables_kobj);
 	if (result)
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 19c3ead..17514cb 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -318,7 +318,7 @@ struct acpi_bus_event {
 	u32 data;
 };
 
-extern struct kset acpi_subsys;
+extern struct kset *acpi_kset;
 extern int acpi_bus_generate_netlink_event(const char*, const char*, u8, int);
 /*
  * External Functions
-- 
1.5.3.4

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux