From 3514faca19a6fdc209734431c509631ea92b094e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 16 Oct 2007 10:11:44 -0600 Subject: kobject: remove struct kobj_type from struct kset We don't need a "default" ktype for a kset. We should set this explicitly every time for each kset. This change is needed so that we can make ksets dynamic, and cleans up one of the odd, undocumented assumption that the kset/kobject/ktype model has. This patch is based on a lot of help from Kay Sievers. Nasty bug in the block code was found by Dave Young Cc: Kay Sievers Cc: Dave Young Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/acpi/bus.c') diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index f4487c3..7c172d9 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -743,7 +743,7 @@ static int __init acpi_bus_init(void) return -ENODEV; } -decl_subsys(acpi, NULL, NULL); +decl_subsys(acpi, NULL); static int __init acpi_init(void) { -- cgit v1.1 From 99e0d2fc6c60ca44f56203eeda9fc0e07b508f06 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 2 Nov 2007 16:19:59 -0700 Subject: 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 Cc: Len Brown Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/bus.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'drivers/acpi/bus.c') diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 7c172d9..e550da6 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -743,7 +743,7 @@ static int __init acpi_bus_init(void) return -ENODEV; } -decl_subsys(acpi, NULL); +struct kobject *acpi_kobj; static int __init acpi_init(void) { @@ -755,10 +755,11 @@ 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", - __FUNCTION__, result); + acpi_kobj = kobject_create_and_add("acpi", &firmware_kset->kobj); + if (!acpi_kobj) { + printk(KERN_WARNING "%s: kset create error\n", __FUNCTION__); + acpi_kobj = NULL; + } result = acpi_bus_init(); -- cgit v1.1 From f62ed9e33b3ccff54d66b08f82d11940bb9e269b Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 5 Nov 2007 13:16:15 -0800 Subject: firmware: change firmware_kset to firmware_kobj There is no firmware "subsystem" it's just a directory in /sys that other portions of the kernel want to hook into. So make it a kobject not a kset to help alivate anyone who tries to do some odd kset-like things with this. Cc: Kay Sievers Cc: Cornelia Huck Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/acpi/bus.c') diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index e550da6..1b4cf98 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -755,7 +755,7 @@ static int __init acpi_init(void) return -ENODEV; } - acpi_kobj = kobject_create_and_add("acpi", &firmware_kset->kobj); + acpi_kobj = kobject_create_and_add("acpi", firmware_kobj); if (!acpi_kobj) { printk(KERN_WARNING "%s: kset create error\n", __FUNCTION__); acpi_kobj = NULL; -- cgit v1.1