fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / usb / storage / isd200.c
index 8aa136b..6831dca 100644 (file)
@@ -54,9 +54,9 @@
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_device.h>
 
+#include "usb.h"
 #include "transport.h"
 #include "protocol.h"
-#include "usb.h"
 #include "debug.h"
 #include "scsiglue.h"
 #include "isd200.h"
@@ -555,7 +555,7 @@ static void isd200_invoke_transport( struct us_data *us,
        /* if the command gets aborted by the higher layers, we need to
         * short-circuit all other processing
         */
-       if (us->sm_state == US_STATE_ABORTING) {
+       if (test_bit(US_FLIDX_TIMED_OUT, &us->flags)) {
                US_DEBUGP("-- command was aborted\n");
                goto Handle_Abort;
        }
@@ -602,7 +602,7 @@ static void isd200_invoke_transport( struct us_data *us,
 
        if (need_auto_sense) {
                result = isd200_read_regs(us);
-               if (us->sm_state == US_STATE_ABORTING) {
+               if (test_bit(US_FLIDX_TIMED_OUT, &us->flags)) {
                        US_DEBUGP("-- auto-sense aborted\n");
                        goto Handle_Abort;
                }
@@ -1053,12 +1053,6 @@ static int isd200_get_inquiry_data( struct us_data *us )
                                /* Standard IDE interface only supports disks */
                                info->InquiryData.DeviceType = DIRECT_ACCESS_DEVICE;
 
-                               /* Fix-up the return data from an INQUIRY command to show 
-                                * ANSI SCSI rev 2 so we don't confuse the SCSI layers above us
-                                * in Linux.
-                                */
-                               info->InquiryData.Versions = 0x2;
-
                                /* The length must be at least 36 (5 + 31) */
                                info->InquiryData.AdditionalLength = 0x1F;
 
@@ -1367,21 +1361,19 @@ static int isd200_init_info(struct us_data *us)
        struct isd200_info *info;
 
        info = (struct isd200_info *)
-                       kmalloc(sizeof(struct isd200_info), GFP_KERNEL);
+                       kzalloc(sizeof(struct isd200_info), GFP_KERNEL);
        if (!info)
                retStatus = ISD200_ERROR;
        else {
-               memset(info, 0, sizeof(struct isd200_info));
                info->id = (struct hd_driveid *)
-                               kmalloc(sizeof(struct hd_driveid), GFP_KERNEL);
+                               kzalloc(sizeof(struct hd_driveid), GFP_KERNEL);
                info->RegsBuf = (unsigned char *)
                                kmalloc(sizeof(info->ATARegs), GFP_KERNEL);
                if (!info->id || !info->RegsBuf) {
                        isd200_free_info_ptrs(info);
                        kfree(info);
                        retStatus = ISD200_ERROR;
-               } else
-                       memset(info->id, 0, sizeof(struct hd_driveid));
+               }
        }
 
        if (retStatus == ISD200_GOOD) {
@@ -1390,7 +1382,7 @@ static int isd200_init_info(struct us_data *us)
        } else
                US_DEBUGP("ERROR - kmalloc failure\n");
 
-       return(retStatus);
+       return retStatus;
 }
 
 /**************************************************************************