diff options
author | Jens Axboe <axboe@kernel.dk> | 2018-10-26 19:27:02 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-11-07 21:42:32 +0100 |
commit | 5e28b8d8a1b03ce86f33d38a64a4983d2b5c7679 (patch) | |
tree | 382c53cb1bda1974b9a29917a78c6fa59b41350c /block/bsg-lib.c | |
parent | bsg: pass in desired timeout handler (diff) | |
download | linux-5e28b8d8a1b03ce86f33d38a64a4983d2b5c7679.tar.xz linux-5e28b8d8a1b03ce86f33d38a64a4983d2b5c7679.zip |
bsg: provide bsg_remove_queue() helper
All drivers do unregister + cleanup, provide a helper for that.
Cc: linux-scsi@vger.kernel.org
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Tested-by: Benjamin Block <bblock@linux.vnet.ibm.com>
Tested-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/bsg-lib.c')
-rw-r--r-- | block/bsg-lib.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/block/bsg-lib.c b/block/bsg-lib.c index 1da011ec04e6..3f2e9a1bae44 100644 --- a/block/bsg-lib.c +++ b/block/bsg-lib.c @@ -296,6 +296,15 @@ static void bsg_exit_rq(struct request_queue *q, struct request *req) kfree(job->reply); } +void bsg_remove_queue(struct request_queue *q) +{ + if (q) { + bsg_unregister_queue(q); + blk_cleanup_queue(q); + } +} +EXPORT_SYMBOL_GPL(bsg_remove_queue); + /** * bsg_setup_queue - Create and add the bsg hooks so we can receive requests * @dev: device to attach bsg device to |