diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2008-03-30 21:03:39 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-04-18 12:47:49 -0400 |
commit | c3ff1b90d8924dd1c55c3b56a79bfc563ace4a42 (patch) | |
tree | c012845d2203b81afd4b2dade9dc9f0d453da906 /block | |
parent | d45ac4fa8f277e1ec5acfb67ce5d6406555760cf (diff) |
[SCSI] bsg: replace kobject_get with blk_get_queue
Both takes a ref to a queue. But blk_get_queue checks QUEUE_FLAG_DEAD
and is more appropriate interface here.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/bsg.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/block/bsg.c b/block/bsg.c index d8e0cb8dd6be..e2c65a150a79 100644 --- a/block/bsg.c +++ b/block/bsg.c | |||
@@ -740,16 +740,21 @@ static struct bsg_device *bsg_add_device(struct inode *inode, | |||
740 | struct file *file) | 740 | struct file *file) |
741 | { | 741 | { |
742 | struct bsg_device *bd; | 742 | struct bsg_device *bd; |
743 | int ret; | ||
743 | #ifdef BSG_DEBUG | 744 | #ifdef BSG_DEBUG |
744 | unsigned char buf[32]; | 745 | unsigned char buf[32]; |
745 | #endif | 746 | #endif |
747 | ret = blk_get_queue(rq); | ||
748 | if (ret) | ||
749 | return ERR_PTR(-ENXIO); | ||
746 | 750 | ||
747 | bd = bsg_alloc_device(); | 751 | bd = bsg_alloc_device(); |
748 | if (!bd) | 752 | if (!bd) { |
753 | blk_put_queue(rq); | ||
749 | return ERR_PTR(-ENOMEM); | 754 | return ERR_PTR(-ENOMEM); |
755 | } | ||
750 | 756 | ||
751 | bd->queue = rq; | 757 | bd->queue = rq; |
752 | kobject_get(&rq->kobj); | ||
753 | bsg_set_block(bd, file); | 758 | bsg_set_block(bd, file); |
754 | 759 | ||
755 | atomic_set(&bd->ref_count, 1); | 760 | atomic_set(&bd->ref_count, 1); |