From a62182f338b39a22035531c6afc0a8d2928b1df2 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 2 Oct 2014 14:39:55 +0200 Subject: 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 Reviewed-by: Bart Van Assche Reviewed-by: Mike Christie Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- drivers/infiniband/ulp/srp/ib_srp.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'drivers/infiniband/ulp/srp') diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 62d2a18e1b41..51670d75ab78 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -2258,28 +2258,6 @@ static int srp_cm_handler(struct ib_cm_id *cm_id, struct ib_cm_event *event) return 0; } -/** - * srp_change_queue_type - changing device queue tag type - * @sdev: scsi device struct - * @tag_type: requested tag type - * - * Returns queue tag type. - */ -static int -srp_change_queue_type(struct scsi_device *sdev, int tag_type) -{ - if (sdev->tagged_supported) { - scsi_set_tag_type(sdev, tag_type); - if (tag_type) - scsi_activate_tcq(sdev, sdev->queue_depth); - else - scsi_deactivate_tcq(sdev, sdev->queue_depth); - } else - tag_type = 0; - - return tag_type; -} - /** * srp_change_queue_depth - setting device queue depth * @sdev: scsi device struct @@ -2600,7 +2578,7 @@ static struct scsi_host_template srp_template = { .info = srp_target_info, .queuecommand = srp_queuecommand, .change_queue_depth = srp_change_queue_depth, - .change_queue_type = srp_change_queue_type, + .change_queue_type = scsi_change_queue_type, .eh_abort_handler = srp_abort, .eh_device_reset_handler = srp_reset_device, .eh_host_reset_handler = srp_reset_host, -- cgit v1.2.3