aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-sysfs.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2008-08-25 06:56:05 -0400
committerJens Axboe <jens.axboe@oracle.com>2008-10-09 02:56:07 -0400
commited9e1982347b36573cd622ee5f4e2a7ccd79b3fd (patch)
tree79d834094d655ec97cfc0a382a9207ebc8e711a5 /block/blk-sysfs.c
parent870d6656126add8e383645732b03df2b7ccd4f94 (diff)
block: implement and use {disk|part}_to_dev()
Implement {disk|part}_to_dev() and use them to access generic device instead of directly dereferencing {disk|part}->dev. To make sure no user is left behind, rename generic devices fields to __dev. This is in preparation of unifying partition 0 handling with other partitions. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk-sysfs.c')
-rw-r--r--block/blk-sysfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 304ec73ab821..b9a6ed166649 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -310,7 +310,7 @@ int blk_register_queue(struct gendisk *disk)
310 if (!q->request_fn) 310 if (!q->request_fn)
311 return 0; 311 return 0;
312 312
313 ret = kobject_add(&q->kobj, kobject_get(&disk->dev.kobj), 313 ret = kobject_add(&q->kobj, kobject_get(&disk_to_dev(disk)->kobj),
314 "%s", "queue"); 314 "%s", "queue");
315 if (ret < 0) 315 if (ret < 0)
316 return ret; 316 return ret;
@@ -339,6 +339,6 @@ void blk_unregister_queue(struct gendisk *disk)
339 339
340 kobject_uevent(&q->kobj, KOBJ_REMOVE); 340 kobject_uevent(&q->kobj, KOBJ_REMOVE);
341 kobject_del(&q->kobj); 341 kobject_del(&q->kobj);
342 kobject_put(&disk->dev.kobj); 342 kobject_put(&disk_to_dev(disk)->kobj);
343 } 343 }
344} 344}