megaraid_sas: Expose TAPE drives unconditionally
authorsumit.saxena@avagotech.com <sumit.saxena@avagotech.com>
Thu, 15 Oct 2015 08:09:24 +0000 (13:39 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 29 Oct 2015 07:05:11 +0000 (03:05 -0400)
Expose non-disk (TAPE drive, CD-ROM) unconditionally.

Cc: <stable@vger.kernel.org>
Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/megaraid/megaraid_sas_base.c

index 04a1edc0afc8ff54eb9672ae16400eb8ea111fa2..00a360b8f29b730e7de5c407b7d49e8dfd3ef914 100644 (file)
@@ -1743,8 +1743,9 @@ static int megasas_slave_alloc(struct scsi_device *sdev)
                pd_index =
                        (sdev->channel * MEGASAS_MAX_DEV_PER_CHANNEL) +
                        sdev->id;
-               if (instance->pd_list[pd_index].driveState ==
-                                       MR_PD_STATE_SYSTEM) {
+               if ((instance->pd_list[pd_index].driveState ==
+                       MR_PD_STATE_SYSTEM) ||
+                       (instance->pd_list[pd_index].driveType != TYPE_DISK)) {
                        return 0;
                }
                return -ENXIO;