Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=29e3dd0df1b9556170ce90484a9d1a2ff9104ea7
Commit:     29e3dd0df1b9556170ce90484a9d1a2ff9104ea7
Parent:     edfaa7c36574f1bf09c65ad602412db9da5f96bf
Author:     Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Mon Dec 17 23:05:35 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jan 24 20:40:36 2008 -0800

    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 <[EMAIL PROTECTED]>
    Cc: Kay Sievers <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 block/elevator.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/block/elevator.c b/block/elevator.c
index e452deb..5445c3c 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -185,9 +185,7 @@ static elevator_t *elevator_alloc(struct request_queue *q,
 
        eq->ops = &e->ops;
        eq->elevator_type = e;
-       kobject_init(&eq->kobj);
-       kobject_set_name(&eq->kobj, "%s", "iosched");
-       eq->kobj.ktype = &elv_ktype;
+       kobject_init_ng(&eq->kobj, &elv_ktype);
        mutex_init(&eq->sysfs_lock);
 
        eq->hash = kmalloc_node(sizeof(struct hlist_head) * ELV_HASH_ENTRIES,
@@ -931,9 +929,7 @@ int elv_register_queue(struct request_queue *q)
        elevator_t *e = q->elevator;
        int error;
 
-       e->kobj.parent = &q->kobj;
-
-       error = kobject_add(&e->kobj);
+       error = kobject_add_ng(&e->kobj, &q->kobj, "%s", "iosched");
        if (!error) {
                struct elv_fs_entry *attr = e->elevator_type->elevator_attrs;
                if (attr) {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to