|
@@ -3765,7 +3765,6 @@ fc_bsg_hostadd(struct Scsi_Host *shost, struct fc_host_attrs *fc_host)
|
|
|
struct device *dev = &shost->shost_gendev;
|
|
|
struct fc_internal *i = to_fc_internal(shost->transportt);
|
|
|
struct request_queue *q;
|
|
|
- int err;
|
|
|
char bsg_name[20];
|
|
|
|
|
|
fc_host->rqst_q = NULL;
|
|
@@ -3776,24 +3775,14 @@ fc_bsg_hostadd(struct Scsi_Host *shost, struct fc_host_attrs *fc_host)
|
|
|
snprintf(bsg_name, sizeof(bsg_name),
|
|
|
"fc_host%d", shost->host_no);
|
|
|
|
|
|
- q = blk_init_queue(bsg_request_fn, NULL);
|
|
|
- if (!q) {
|
|
|
- dev_err(dev,
|
|
|
- "fc_host%d: bsg interface failed to initialize - no request queue\n",
|
|
|
- shost->host_no);
|
|
|
- return -ENOMEM;
|
|
|
- }
|
|
|
-
|
|
|
- __scsi_init_queue(shost, q);
|
|
|
- err = bsg_setup_queue(dev, q, bsg_name, fc_bsg_dispatch,
|
|
|
- i->f->dd_bsg_size);
|
|
|
- if (err) {
|
|
|
+ q = bsg_setup_queue(dev, bsg_name, fc_bsg_dispatch, i->f->dd_bsg_size);
|
|
|
+ if (IS_ERR(q)) {
|
|
|
dev_err(dev,
|
|
|
"fc_host%d: bsg interface failed to initialize - setup queue\n",
|
|
|
shost->host_no);
|
|
|
- blk_cleanup_queue(q);
|
|
|
- return err;
|
|
|
+ return PTR_ERR(q);
|
|
|
}
|
|
|
+ __scsi_init_queue(shost, q);
|
|
|
blk_queue_rq_timed_out(q, fc_bsg_job_timeout);
|
|
|
blk_queue_rq_timeout(q, FC_DEFAULT_BSG_TIMEOUT);
|
|
|
fc_host->rqst_q = q;
|
|
@@ -3825,27 +3814,18 @@ fc_bsg_rportadd(struct Scsi_Host *shost, struct fc_rport *rport)
|
|
|
struct device *dev = &rport->dev;
|
|
|
struct fc_internal *i = to_fc_internal(shost->transportt);
|
|
|
struct request_queue *q;
|
|
|
- int err;
|
|
|
|
|
|
rport->rqst_q = NULL;
|
|
|
|
|
|
if (!i->f->bsg_request)
|
|
|
return -ENOTSUPP;
|
|
|
|
|
|
- q = blk_init_queue(bsg_request_fn, NULL);
|
|
|
- if (!q) {
|
|
|
- dev_err(dev, "bsg interface failed to initialize - no request queue\n");
|
|
|
- return -ENOMEM;
|
|
|
- }
|
|
|
-
|
|
|
- __scsi_init_queue(shost, q);
|
|
|
- err = bsg_setup_queue(dev, q, NULL, fc_bsg_dispatch, i->f->dd_bsg_size);
|
|
|
- if (err) {
|
|
|
+ q = bsg_setup_queue(dev, NULL, fc_bsg_dispatch, i->f->dd_bsg_size);
|
|
|
+ if (IS_ERR(q)) {
|
|
|
dev_err(dev, "failed to setup bsg queue\n");
|
|
|
- blk_cleanup_queue(q);
|
|
|
- return err;
|
|
|
+ return PTR_ERR(q);
|
|
|
}
|
|
|
-
|
|
|
+ __scsi_init_queue(shost, q);
|
|
|
blk_queue_prep_rq(q, fc_bsg_rport_prep);
|
|
|
blk_queue_rq_timed_out(q, fc_bsg_job_timeout);
|
|
|
blk_queue_rq_timeout(q, BLK_DEFAULT_SG_TIMEOUT);
|