USB: serial: visor: fix crash on detecting device without write_urbs
[pandora-kernel.git] / drivers / usb / storage / cypress_atacb.c
index c844718..7341ce2 100644 (file)
@@ -248,14 +248,26 @@ static int cypress_probe(struct usb_interface *intf,
 {
        struct us_data *us;
        int result;
+       struct usb_device *device;
 
        result = usb_stor_probe1(&us, intf, id,
                        (id - cypress_usb_ids) + cypress_unusual_dev_list);
        if (result)
                return result;
 
-       us->protocol_name = "Transparent SCSI with Cypress ATACB";
-       us->proto_handler = cypress_atacb_passthrough;
+       /* Among CY7C68300 chips, the A revision does not support Cypress ATACB
+        * Filter out this revision from EEPROM default descriptor values
+        */
+       device = interface_to_usbdev(intf);
+       if (device->descriptor.iManufacturer != 0x38 ||
+           device->descriptor.iProduct != 0x4e ||
+           device->descriptor.iSerialNumber != 0x64) {
+               us->protocol_name = "Transparent SCSI with Cypress ATACB";
+               us->proto_handler = cypress_atacb_passthrough;
+       } else {
+               us->protocol_name = "Transparent SCSI";
+               us->proto_handler = usb_stor_transparent_scsi_command;
+       }
 
        result = usb_stor_probe2(us);
        return result;