aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_attr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_attr.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_attr.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 488b3d16427b..fee0c493775b 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -507,9 +507,6 @@ qla2x00_zio_show(struct class_device *cdev, char *buf)
507 int len = 0; 507 int len = 0;
508 508
509 switch (ha->zio_mode) { 509 switch (ha->zio_mode) {
510 case QLA_ZIO_MODE_5:
511 len += snprintf(buf + len, PAGE_SIZE-len, "Mode 5\n");
512 break;
513 case QLA_ZIO_MODE_6: 510 case QLA_ZIO_MODE_6:
514 len += snprintf(buf + len, PAGE_SIZE-len, "Mode 6\n"); 511 len += snprintf(buf + len, PAGE_SIZE-len, "Mode 6\n");
515 break; 512 break;
@@ -527,20 +524,16 @@ qla2x00_zio_store(struct class_device *cdev, const char *buf, size_t count)
527 int val = 0; 524 int val = 0;
528 uint16_t zio_mode; 525 uint16_t zio_mode;
529 526
527 if (!IS_ZIO_SUPPORTED(ha))
528 return -ENOTSUPP;
529
530 if (sscanf(buf, "%d", &val) != 1) 530 if (sscanf(buf, "%d", &val) != 1)
531 return -EINVAL; 531 return -EINVAL;
532 532
533 switch (val) { 533 if (val)
534 case 1:
535 zio_mode = QLA_ZIO_MODE_5;
536 break;
537 case 2:
538 zio_mode = QLA_ZIO_MODE_6; 534 zio_mode = QLA_ZIO_MODE_6;
539 break; 535 else
540 default:
541 zio_mode = QLA_ZIO_DISABLED; 536 zio_mode = QLA_ZIO_DISABLED;
542 break;
543 }
544 537
545 /* Update per-hba values and queue a reset. */ 538 /* Update per-hba values and queue a reset. */
546 if (zio_mode != QLA_ZIO_DISABLED || ha->zio_mode != QLA_ZIO_DISABLED) { 539 if (zio_mode != QLA_ZIO_DISABLED || ha->zio_mode != QLA_ZIO_DISABLED) {