Commit d5a379f7 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Kobject: convert block/ll_rw_blk.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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 29e3dd0d
...@@ -1862,9 +1862,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) ...@@ -1862,9 +1862,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
init_timer(&q->unplug_timer); init_timer(&q->unplug_timer);
kobject_set_name(&q->kobj, "%s", "queue"); kobject_init_ng(&q->kobj, &queue_ktype);
q->kobj.ktype = &queue_ktype;
kobject_init(&q->kobj);
mutex_init(&q->sysfs_lock); mutex_init(&q->sysfs_lock);
...@@ -4182,9 +4180,8 @@ int blk_register_queue(struct gendisk *disk) ...@@ -4182,9 +4180,8 @@ int blk_register_queue(struct gendisk *disk)
if (!q || !q->request_fn) if (!q || !q->request_fn)
return -ENXIO; return -ENXIO;
q->kobj.parent = kobject_get(&disk->dev.kobj); ret = kobject_add_ng(&q->kobj, kobject_get(&disk->dev.kobj),
"%s", "queue");
ret = kobject_add(&q->kobj);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment