staging: keucr: fix keucr lost disconnect in transport
authorAl Cho <acho@novell.com>
Fri, 24 Sep 2010 10:50:11 +0000 (18:50 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 30 Sep 2010 11:33:26 +0000 (04:33 -0700)
The other part of keucr lost usb disconnect.
Unplug SDcard after thread scan,the wrong rule in usb_stor_port_reset,
so the driver still fail in stress test.

Signed-off-by: Al Cho <acho@novell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/keucr/transport.c

index 7215429759bcf39af1775d1b6f45c75716b449e3..445a62ce693197d06fe79c4ad37f2f83a45fbb48 100644 (file)
@@ -763,24 +763,19 @@ int usb_stor_port_reset(struct us_data *us)
        int result, rc_lock;
 
        //printk("transport --- usb_stor_port_reset\n");
-       result = rc_lock = usb_lock_device_for_reset(us->pusb_dev, us->pusb_intf);
+       result = usb_lock_device_for_reset(us->pusb_dev, us->pusb_intf);
        if (result < 0)
                printk("unable to lock device for reset: %d\n", result);
-       else
-       {
+       else {
                /* Were we disconnected while waiting for the lock? */
-               if (test_bit(US_FLIDX_DISCONNECTING, &us->dflags))
-               {
+               if (test_bit(US_FLIDX_DISCONNECTING, &us->dflags)) {
                        result = -EIO;
                        //printk("No reset during disconnect\n");
-               }
-               else
-               {
+               } else {
                        result = usb_reset_device(us->pusb_dev);
                        //printk("usb_reset_composite_device returns %d\n", result);
                }
-               if (rc_lock)
-                       usb_unlock_device(us->pusb_dev);
+               usb_unlock_device(us->pusb_dev);
        }
        return result;
 }