diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-12-18 01:05:35 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-24 23:40:36 -0500 |
commit | 29e3dd0df1b9556170ce90484a9d1a2ff9104ea7 (patch) | |
tree | 63552639fe2c05e96fdc5a02f234b10ec78866f5 /block | |
parent | edfaa7c36574f1bf09c65ad602412db9da5f96bf (diff) |
Kobject: convert block/elevator.c to use kobject_init/add_ng()
This converts the code to use the new kobject functions, cleaning up the
logic in doing so.
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'block')
-rw-r--r-- | block/elevator.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/block/elevator.c b/block/elevator.c index e452deb80395..5445c3c2ee8a 100644 --- a/block/elevator.c +++ b/block/elevator.c | |||
@@ -185,9 +185,7 @@ static elevator_t *elevator_alloc(struct request_queue *q, | |||
185 | 185 | ||
186 | eq->ops = &e->ops; | 186 | eq->ops = &e->ops; |
187 | eq->elevator_type = e; | 187 | eq->elevator_type = e; |
188 | kobject_init(&eq->kobj); | 188 | kobject_init_ng(&eq->kobj, &elv_ktype); |
189 | kobject_set_name(&eq->kobj, "%s", "iosched"); | ||
190 | eq->kobj.ktype = &elv_ktype; | ||
191 | mutex_init(&eq->sysfs_lock); | 189 | mutex_init(&eq->sysfs_lock); |
192 | 190 | ||
193 | eq->hash = kmalloc_node(sizeof(struct hlist_head) * ELV_HASH_ENTRIES, | 191 | eq->hash = kmalloc_node(sizeof(struct hlist_head) * ELV_HASH_ENTRIES, |
@@ -931,9 +929,7 @@ int elv_register_queue(struct request_queue *q) | |||
931 | elevator_t *e = q->elevator; | 929 | elevator_t *e = q->elevator; |
932 | int error; | 930 | int error; |
933 | 931 | ||
934 | e->kobj.parent = &q->kobj; | 932 | error = kobject_add_ng(&e->kobj, &q->kobj, "%s", "iosched"); |
935 | |||
936 | error = kobject_add(&e->kobj); | ||
937 | if (!error) { | 933 | if (!error) { |
938 | struct elv_fs_entry *attr = e->elevator_type->elevator_attrs; | 934 | struct elv_fs_entry *attr = e->elevator_type->elevator_attrs; |
939 | if (attr) { | 935 | if (attr) { |