Commit 3514faca authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

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
<hidave.darkstar@gmail.com>

Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c11c4154
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ static struct subsys_attribute auto_poweron_attr = {
};

#ifndef CONFIG_PM
decl_subsys(power,NULL,NULL);
decl_subsys(power, NULL);

static struct attribute *g[] = {
        &auto_poweron_attr.attr,
+2 −2
Original line number Diff line number Diff line
@@ -490,7 +490,7 @@ static struct super_operations hypfs_s_ops = {
	.show_options	= hypfs_show_options,
};

static decl_subsys(s390, NULL, NULL);
static decl_subsys(s390, NULL);

static int __init hypfs_init(void)
{
@@ -506,7 +506,7 @@ static int __init hypfs_init(void)
			goto fail_diag;
		}
	}
	kobj_set_kset_s(&s390_subsys, hypervisor_subsys);
	s390_subsys.kobj.kset = &hypervisor_subsys;
	rc = subsystem_register(&s390_subsys);
	if (rc)
		goto fail_sysfs;
+4 −4
Original line number Diff line number Diff line
@@ -418,7 +418,7 @@ static struct attribute_group ipl_unknown_attr_group = {
	.attrs = ipl_unknown_attrs,
};

static decl_subsys(ipl, NULL, NULL);
static decl_subsys(ipl, NULL);

/*
 * reipl section
@@ -590,7 +590,7 @@ static ssize_t reipl_type_store(struct kset *kset, const char *buf,
static struct subsys_attribute reipl_type_attr =
		__ATTR(reipl_type, 0644, reipl_type_show, reipl_type_store);

static decl_subsys(reipl, NULL, NULL);
static decl_subsys(reipl, NULL);

/*
 * dump section
@@ -685,13 +685,13 @@ static ssize_t dump_type_store(struct kset *kset, const char *buf,
static struct subsys_attribute dump_type_attr =
		__ATTR(dump_type, 0644, dump_type_show, dump_type_store);

static decl_subsys(dump, NULL, NULL);
static decl_subsys(dump, NULL);

/*
 * Shutdown actions section
 */

static decl_subsys(shutdown_actions, NULL, NULL);
static decl_subsys(shutdown_actions, NULL);

/* on panic */

+3 −2
Original line number Diff line number Diff line
@@ -584,7 +584,7 @@ static struct kset_uevent_ops block_uevent_ops = {
	.uevent		= block_uevent,
};

decl_subsys(block, &ktype_block, &block_uevent_ops);
decl_subsys(block, &block_uevent_ops);

/*
 * aggregate disk stat collector.  Uses the same stats that the sysfs
@@ -721,7 +721,8 @@ struct gendisk *alloc_disk_node(int minors, int node_id)
			}
		}
		disk->minors = minors;
		kobj_set_kset_s(disk,block_subsys);
		disk->kobj.kset = &block_subsys;
		disk->kobj.ktype = &ktype_block;
		kobject_init(&disk->kobj);
		rand_initialize_disk(disk);
		INIT_WORK(&disk->async_notify,
+1 −1
Original line number Diff line number Diff line
@@ -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)
{
Loading