Skip to content

Commit ba8256c

Browse files
committed
Add support for GEN5 devices in kernel driver code
1 parent 62bee98 commit ba8256c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

switchtec.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ static ssize_t field ## _show(struct device *dev, \
371371
if (stdev->gen == SWITCHTEC_GEN3) \
372372
return io_string_show(buf, &si->gen3.field, \
373373
sizeof(si->gen3.field)); \
374-
else if (stdev->gen == SWITCHTEC_GEN4) \
374+
else if (stdev->gen >= SWITCHTEC_GEN4) \
375375
return io_string_show(buf, &si->gen4.field, \
376376
sizeof(si->gen4.field)); \
377377
else \
@@ -663,7 +663,7 @@ static int ioctl_flash_info(struct switchtec_dev *stdev,
663663
if (stdev->gen == SWITCHTEC_GEN3) {
664664
info.flash_length = ioread32(&fi->gen3.flash_length);
665665
info.num_partitions = SWITCHTEC_NUM_PARTITIONS_GEN3;
666-
} else if (stdev->gen == SWITCHTEC_GEN4) {
666+
} else if (stdev->gen >= SWITCHTEC_GEN4) {
667667
info.flash_length = ioread32(&fi->gen4.flash_length);
668668
info.num_partitions = SWITCHTEC_NUM_PARTITIONS_GEN4;
669669
} else {
@@ -869,7 +869,7 @@ static int ioctl_flash_part_info(struct switchtec_dev *stdev,
869869
ret = flash_part_info_gen3(stdev, &info);
870870
if (ret)
871871
return ret;
872-
} else if (stdev->gen == SWITCHTEC_GEN4) {
872+
} else if (stdev->gen >= SWITCHTEC_GEN4) {
873873
ret = flash_part_info_gen4(stdev, &info);
874874
if (ret)
875875
return ret;
@@ -1612,7 +1612,7 @@ static int switchtec_init_pci(struct switchtec_dev *stdev,
16121612

16131613
if (stdev->gen == SWITCHTEC_GEN3)
16141614
part_id = &stdev->mmio_sys_info->gen3.partition_id;
1615-
else if (stdev->gen == SWITCHTEC_GEN4)
1615+
else if (stdev->gen >= SWITCHTEC_GEN4)
16161616
part_id = &stdev->mmio_sys_info->gen4.partition_id;
16171617
else
16181618
return -ENOTSUPP;

0 commit comments

Comments
 (0)