diff options
Diffstat (limited to 'drivers/scsi/scsi_sysfs.c')
-rw-r--r-- | drivers/scsi/scsi_sysfs.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index f4cb7b3e9e23..1cb64a8e18c9 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c | |||
@@ -727,9 +727,7 @@ show_queue_type_field(struct device *dev, struct device_attribute *attr, | |||
727 | struct scsi_device *sdev = to_scsi_device(dev); | 727 | struct scsi_device *sdev = to_scsi_device(dev); |
728 | const char *name = "none"; | 728 | const char *name = "none"; |
729 | 729 | ||
730 | if (sdev->ordered_tags) | 730 | if (sdev->simple_tags) |
731 | name = "ordered"; | ||
732 | else if (sdev->simple_tags) | ||
733 | name = "simple"; | 731 | name = "simple"; |
734 | 732 | ||
735 | return snprintf(buf, 20, "%s\n", name); | 733 | return snprintf(buf, 20, "%s\n", name); |
@@ -747,9 +745,12 @@ store_queue_type_field(struct device *dev, struct device_attribute *attr, | |||
747 | if (!sdev->tagged_supported || !sht->change_queue_type) | 745 | if (!sdev->tagged_supported || !sht->change_queue_type) |
748 | return -EINVAL; | 746 | return -EINVAL; |
749 | 747 | ||
750 | if (strncmp(buf, "ordered", 7) == 0) | 748 | /* |
751 | tag_type = MSG_ORDERED_TAG; | 749 | * We're never issueing order tags these days, but allow the value |
752 | else if (strncmp(buf, "simple", 6) == 0) | 750 | * for backwards compatibility. |
751 | */ | ||
752 | if (strncmp(buf, "ordered", 7) == 0 || | ||
753 | strncmp(buf, "simple", 6) == 0) | ||
753 | tag_type = MSG_SIMPLE_TAG; | 754 | tag_type = MSG_SIMPLE_TAG; |
754 | else if (strncmp(buf, "none", 4) != 0) | 755 | else if (strncmp(buf, "none", 4) != 0) |
755 | return -EINVAL; | 756 | return -EINVAL; |
@@ -876,11 +877,10 @@ sdev_store_queue_depth(struct device *dev, struct device_attribute *attr, | |||
876 | 877 | ||
877 | depth = simple_strtoul(buf, NULL, 0); | 878 | depth = simple_strtoul(buf, NULL, 0); |
878 | 879 | ||
879 | if (depth < 1) | 880 | if (depth < 1 || depth > sht->can_queue) |
880 | return -EINVAL; | 881 | return -EINVAL; |
881 | 882 | ||
882 | retval = sht->change_queue_depth(sdev, depth, | 883 | retval = sht->change_queue_depth(sdev, depth); |
883 | SCSI_QDEPTH_DEFAULT); | ||
884 | if (retval < 0) | 884 | if (retval < 0) |
885 | return retval; | 885 | return retval; |
886 | 886 | ||