aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 4c14cde3295f..a4a6a146fccd 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -1538,6 +1538,7 @@ qla2x00_set_model_info(scsi_qla_host_t *vha, uint8_t *model, size_t len,
1538 char *st, *en; 1538 char *st, *en;
1539 uint16_t index; 1539 uint16_t index;
1540 struct qla_hw_data *ha = vha->hw; 1540 struct qla_hw_data *ha = vha->hw;
1541 int use_tbl = !IS_QLA25XX(ha) && IS_QLA81XX(ha);
1541 1542
1542 if (memcmp(model, BINZERO, len) != 0) { 1543 if (memcmp(model, BINZERO, len) != 0) {
1543 strncpy(ha->model_number, model, len); 1544 strncpy(ha->model_number, model, len);
@@ -1550,14 +1551,16 @@ qla2x00_set_model_info(scsi_qla_host_t *vha, uint8_t *model, size_t len,
1550 } 1551 }
1551 1552
1552 index = (ha->pdev->subsystem_device & 0xff); 1553 index = (ha->pdev->subsystem_device & 0xff);
1553 if (ha->pdev->subsystem_vendor == PCI_VENDOR_ID_QLOGIC && 1554 if (use_tbl &&
1555 ha->pdev->subsystem_vendor == PCI_VENDOR_ID_QLOGIC &&
1554 index < QLA_MODEL_NAMES) 1556 index < QLA_MODEL_NAMES)
1555 strncpy(ha->model_desc, 1557 strncpy(ha->model_desc,
1556 qla2x00_model_name[index * 2 + 1], 1558 qla2x00_model_name[index * 2 + 1],
1557 sizeof(ha->model_desc) - 1); 1559 sizeof(ha->model_desc) - 1);
1558 } else { 1560 } else {
1559 index = (ha->pdev->subsystem_device & 0xff); 1561 index = (ha->pdev->subsystem_device & 0xff);
1560 if (ha->pdev->subsystem_vendor == PCI_VENDOR_ID_QLOGIC && 1562 if (use_tbl &&
1563 ha->pdev->subsystem_vendor == PCI_VENDOR_ID_QLOGIC &&
1561 index < QLA_MODEL_NAMES) { 1564 index < QLA_MODEL_NAMES) {
1562 strcpy(ha->model_number, 1565 strcpy(ha->model_number,
1563 qla2x00_model_name[index * 2]); 1566 qla2x00_model_name[index * 2]);