aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pmcraid.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-10-02 08:39:55 -0400
committerChristoph Hellwig <hch@lst.de>2014-11-12 05:19:39 -0500
commita62182f338b39a22035531c6afc0a8d2928b1df2 (patch)
tree57ca6cea82a09d2655daf5c161024c5015373646 /drivers/scsi/pmcraid.c
parent1d5203284d8acbdfdf9b478d434450b34f338f28 (diff)
scsi: provide a generic change_queue_type method
Most drivers use exactly the same implementation, so provide it as a library function. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.de>
Diffstat (limited to 'drivers/scsi/pmcraid.c')
-rw-r--r--drivers/scsi/pmcraid.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index bcb64eb1387f..2233ed6b89e3 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -321,16 +321,10 @@ static int pmcraid_change_queue_type(struct scsi_device *scsi_dev, int tag)
321 struct pmcraid_resource_entry *res; 321 struct pmcraid_resource_entry *res;
322 322
323 res = (struct pmcraid_resource_entry *)scsi_dev->hostdata; 323 res = (struct pmcraid_resource_entry *)scsi_dev->hostdata;
324 324 if (res && scsi_dev->tagged_supported &&
325 if ((res) && scsi_dev->tagged_supported && 325 (RES_IS_GSCSI(res->cfg_entry) || RES_IS_VSET(res->cfg_entry)))
326 (RES_IS_GSCSI(res->cfg_entry) || RES_IS_VSET(res->cfg_entry))) { 326 tag = scsi_change_queue_type(scsi_dev, tag);
327 scsi_set_tag_type(scsi_dev, tag); 327 else
328
329 if (tag)
330 scsi_activate_tcq(scsi_dev, scsi_dev->queue_depth);
331 else
332 scsi_deactivate_tcq(scsi_dev, scsi_dev->queue_depth);
333 } else
334 tag = 0; 328 tag = 0;
335 329
336 return tag; 330 return tag;