diff options
Diffstat (limited to 'block/elevator.c')
-rw-r--r-- | block/elevator.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/block/elevator.c b/block/elevator.c index 446aea2a3cfb..f9736fbdab03 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(&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(&e->kobj, &q->kobj, "%s", "iosched"); if (!error) { struct elv_fs_entry *attr = e->elevator_type->elevator_attrs; if (attr) { @@ -960,7 +956,7 @@ void elv_unregister_queue(struct request_queue *q) __elv_unregister_queue(q->elevator); } -int elv_register(struct elevator_type *e) +void elv_register(struct elevator_type *e) { char *def = ""; @@ -975,7 +971,6 @@ int elv_register(struct elevator_type *e) def = " (default)"; printk(KERN_INFO "io scheduler %s registered%s\n", e->elevator_name, def); - return 0; } EXPORT_SYMBOL_GPL(elv_register); |