diff options
author | Christoph Hellwig <hch@lst.de> | 2017-01-03 15:25:02 +0300 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-01-27 15:08:35 -0700 |
commit | 8ae94eb65be9425af4d57a4f4cfebfdf03081e93 (patch) | |
tree | 79ae2a0249299fc20b42dd877bf01390f50a8547 /drivers/scsi/scsi_transport_iscsi.c | |
parent | e9c787e65c0c36529745be47d490d998b4b6e589 (diff) | |
download | linux-8ae94eb65be9425af4d57a4f4cfebfdf03081e93.tar.gz linux-8ae94eb65be9425af4d57a4f4cfebfdf03081e93.tar.bz2 linux-8ae94eb65be9425af4d57a4f4cfebfdf03081e93.zip |
block/bsg: move queue creation into bsg_setup_queue
Simply the boilerplate code needed for bsg nodes a bit.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/scsi/scsi_transport_iscsi.c')
-rw-r--r-- | drivers/scsi/scsi_transport_iscsi.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 04ebe6e65b83..568c9f26a561 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -1537,25 +1537,18 @@ iscsi_bsg_host_add(struct Scsi_Host *shost, struct iscsi_cls_host *ihost) struct iscsi_internal *i = to_iscsi_internal(shost->transportt); struct request_queue *q; char bsg_name[20]; - int ret; if (!i->iscsi_transport->bsg_request) return -ENOTSUPP; snprintf(bsg_name, sizeof(bsg_name), "iscsi_host%d", shost->host_no); - - q = blk_init_queue(bsg_request_fn, NULL); - if (!q) - return -ENOMEM; - - __scsi_init_queue(shost, q); - ret = bsg_setup_queue(dev, q, bsg_name, iscsi_bsg_host_dispatch, 0); - if (ret) { + q = bsg_setup_queue(dev, bsg_name, iscsi_bsg_host_dispatch, 0); + if (IS_ERR(q)) { shost_printk(KERN_ERR, shost, "bsg interface failed to " "initialize - no request queue\n"); - blk_cleanup_queue(q); - return ret; + return PTR_ERR(q); } + __scsi_init_queue(shost, q); ihost->bsg_q = q; return 0; |