]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/scsi/scsi_lib.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq
[karo-tx-linux.git] / drivers / scsi / scsi_lib.c
index 4c4add53d69b27a377e3909cc059d290441bc297..08af9aae7df38e22f86c6d17da7dc4fc491edb72 100644 (file)
@@ -920,22 +920,20 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
         * Next deal with any sectors which we were able to correctly
         * handle.
         */
-       if (good_bytes > 0) {
-               SCSI_LOG_HLCOMPLETE(1, printk("%ld sectors total, "
-                                             "%d bytes done.\n",
-                                             req->nr_sectors, good_bytes));
-               SCSI_LOG_HLCOMPLETE(1, printk("use_sg is %d\n", cmd->use_sg));
-
-               if (clear_errors)
-                       req->errors = 0;
-
-               /* A number of bytes were successfully read.  If there
-                * is leftovers and there is some kind of error
-                * (result != 0), retry the rest.
-                */
-               if (scsi_end_request(cmd, 1, good_bytes, !!result) == NULL)
-                       return;
-       }
+       SCSI_LOG_HLCOMPLETE(1, printk("%ld sectors total, "
+                                     "%d bytes done.\n",
+                                     req->nr_sectors, good_bytes));
+       SCSI_LOG_HLCOMPLETE(1, printk("use_sg is %d\n", cmd->use_sg));
+
+       if (clear_errors)
+               req->errors = 0;
+
+       /* A number of bytes were successfully read.  If there
+        * are leftovers and there is some kind of error
+        * (result != 0), retry the rest.
+        */
+       if (scsi_end_request(cmd, 1, good_bytes, result == 0) == NULL)
+               return;
 
        /* good_bytes = 0, or (inclusive) there were leftovers and
         * result = 0, so scsi_end_request couldn't retry.
@@ -2026,6 +2024,7 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state)
                switch (oldstate) {
                case SDEV_CREATED:
                case SDEV_RUNNING:
+               case SDEV_QUIESCE:
                case SDEV_OFFLINE:
                case SDEV_BLOCK:
                        break;
@@ -2036,6 +2035,9 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state)
 
        case SDEV_DEL:
                switch (oldstate) {
+               case SDEV_CREATED:
+               case SDEV_RUNNING:
+               case SDEV_OFFLINE:
                case SDEV_CANCEL:
                        break;
                default: