]> git.baikalelectronics.ru Git - kernel.git/commit
block: fix blk_register_queue() return value
authorAkinobu Mita <akinobu.mita@gmail.com>
Mon, 21 Apr 2008 07:51:06 +0000 (09:51 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 21 Apr 2008 07:51:06 +0000 (09:51 +0200)
commit0eb7a6fdb5c3a32ce994915c5da8ea4f0882f93a
treec50ed0dd313e7fcffddd021639473f001fcf8b05
parent444cf359b65eb5afb54cfa51c69cb6c62f6ffa14
block: fix blk_register_queue() return value

blk_register_queue() returns -ENXIO when queue->request_fn is NULL.  But there
are some block drivers that call blk_register_queue() via add_disk() with
queue->request_fn == NULL.  (For example, brd, loop)

Although no one checks return value of blk_register_queue(), this patch makes
it return 0 instead of -ENXIO when queue->request_fn is NULL,

Also this patch adds warning when blk_register_queue() and
blk_unregister_queue() are called with queue == NULL rather than ignore
invalid usage silently.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
block/blk-sysfs.c