This converts the code to use the new kobject functions, cleaning up the
logic in doing so.

Cc: Jens Axboe <[EMAIL PROTECTED]>
Cc: Kay Sievers <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 block/ll_rw_blk.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index 3887b2a..8054b7d 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -1862,9 +1862,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t 
gfp_mask, int node_id)
 
        init_timer(&q->unplug_timer);
 
-       kobject_set_name(&q->kobj, "%s", "queue");
-       q->kobj.ktype = &queue_ktype;
-       kobject_init(&q->kobj);
+       kobject_init_ng(&q->kobj, &queue_ktype);
 
        mutex_init(&q->sysfs_lock);
 
@@ -4182,9 +4180,8 @@ int blk_register_queue(struct gendisk *disk)
        if (!q || !q->request_fn)
                return -ENXIO;
 
-       q->kobj.parent = kobject_get(&disk->dev.kobj);
-
-       ret = kobject_add(&q->kobj);
+       ret = kobject_add_ng(&q->kobj, kobject_get(&disk->dev.kobj),
+                            "%s", "queue");
        if (ret < 0)
                return ret;
 
-- 
1.5.3.8

--
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/

Reply via email to