block: misc updates to blk_get_queue()
* blk_get_queue() is peculiar in that it returns 0 on success and 1 on failure instead of 0 / -errno or boolean. Update it such that it returns %true on success and %false on failure. * Make sure the caller checks for the return value. * Separate out __blk_get_queue() which doesn't check whether @q is dead and put it in blk.h. This will be used later. This patch doesn't introduce any functional changes. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
@@ -769,12 +769,10 @@ static struct bsg_device *bsg_add_device(struct inode *inode,
|
||||
struct file *file)
|
||||
{
|
||||
struct bsg_device *bd;
|
||||
int ret;
|
||||
#ifdef BSG_DEBUG
|
||||
unsigned char buf[32];
|
||||
#endif
|
||||
ret = blk_get_queue(rq);
|
||||
if (ret)
|
||||
if (!blk_get_queue(rq))
|
||||
return ERR_PTR(-ENXIO);
|
||||
|
||||
bd = bsg_alloc_device();
|
||||
|
||||
Reference in New Issue
Block a user