net: ntohs() misuse
[safe/jmp/linux-2.6] / drivers / scsi / scsi_transport_spi.c
index 75a64a6..f49f55c 100644 (file)
@@ -109,8 +109,11 @@ static int spi_execute(struct scsi_device *sdev, const void *cmd,
        for(i = 0; i < DV_RETRIES; i++) {
                result = scsi_execute(sdev, cmd, dir, buffer, bufflen,
                                      sense, DV_TIMEOUT, /* retries */ 1,
-                                     REQ_FAILFAST);
-               if (result & DRIVER_SENSE) {
+                                     REQ_FAILFAST_DEV |
+                                     REQ_FAILFAST_TRANSPORT |
+                                     REQ_FAILFAST_DRIVER,
+                                     NULL);
+               if (driver_byte(result) & DRIVER_SENSE) {
                        struct scsi_sense_hdr sshdr_tmp;
                        if (!sshdr)
                                sshdr = &sshdr_tmp;
@@ -366,12 +369,14 @@ spi_transport_rd_attr(rti, "%d\n");
 spi_transport_rd_attr(pcomp_en, "%d\n");
 spi_transport_rd_attr(hold_mcs, "%d\n");
 
-/* we only care about the first child device so we return 1 */
+/* we only care about the first child device that's a real SCSI device
+ * so we return 1 to terminate the iteration when we find it */
 static int child_iter(struct device *dev, void *data)
 {
-       struct scsi_device *sdev = to_scsi_device(dev);
+       if (!scsi_is_sdev_device(dev))
+               return 0;
 
-       spi_dv_device(sdev);
+       spi_dv_device(to_scsi_device(dev));
        return 1;
 }