kobjects: fix up improper use of the kobject name field
A number of different drivers incorrect access the kobject name field directly. This is not correct as the name might not be in the array. Use the proper accessor function instead.
This commit is contained in:
@@ -186,7 +186,7 @@ static elevator_t *elevator_alloc(struct request_queue *q,
|
||||
eq->ops = &e->ops;
|
||||
eq->elevator_type = e;
|
||||
kobject_init(&eq->kobj);
|
||||
snprintf(eq->kobj.name, KOBJ_NAME_LEN, "%s", "iosched");
|
||||
kobject_set_name(&eq->kobj, "%s", "iosched");
|
||||
eq->kobj.ktype = &elv_ktype;
|
||||
mutex_init(&eq->sysfs_lock);
|
||||
|
||||
|
||||
@@ -1854,7 +1854,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
|
||||
|
||||
init_timer(&q->unplug_timer);
|
||||
|
||||
snprintf(q->kobj.name, KOBJ_NAME_LEN, "%s", "queue");
|
||||
kobject_set_name(&q->kobj, "%s", "queue");
|
||||
q->kobj.ktype = &queue_ktype;
|
||||
kobject_init(&q->kobj);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user