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>
This commit is contained in:
@@ -258,7 +258,7 @@ static struct scsi_host_template driver_template = {
|
||||
.slave_alloc = esas2r_slave_alloc,
|
||||
.slave_destroy = esas2r_slave_destroy,
|
||||
.change_queue_depth = esas2r_change_queue_depth,
|
||||
.change_queue_type = esas2r_change_queue_type,
|
||||
.change_queue_type = scsi_change_queue_type,
|
||||
.max_sectors = 0xFFFF,
|
||||
};
|
||||
|
||||
@@ -1268,24 +1268,6 @@ int esas2r_change_queue_depth(struct scsi_device *dev, int depth, int reason)
|
||||
return dev->queue_depth;
|
||||
}
|
||||
|
||||
int esas2r_change_queue_type(struct scsi_device *dev, int type)
|
||||
{
|
||||
esas2r_log(ESAS2R_LOG_INFO, "change_queue_type %p, %d", dev, type);
|
||||
|
||||
if (dev->tagged_supported) {
|
||||
scsi_set_tag_type(dev, type);
|
||||
|
||||
if (type)
|
||||
scsi_activate_tcq(dev, dev->queue_depth);
|
||||
else
|
||||
scsi_deactivate_tcq(dev, dev->queue_depth);
|
||||
} else {
|
||||
type = 0;
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
int esas2r_slave_alloc(struct scsi_device *dev)
|
||||
{
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user