p54usb: fix conflict with recent usb changes
authorChristian Lamparter <chunkeey@web.de>
Fri, 16 Jan 2009 19:24:31 +0000 (20:24 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 29 Jan 2009 21:00:43 +0000 (16:00 -0500)
A recent change in the usb core "USB: change interface to usb_lock_device_for_reset()"
conflicts with "p54usb: utilize usb_reset_device for 3887".

Sadly, we have to call usb_reset_device before we can upload the firmware on 3887.
Unless someone figures out how to reliably stop the 3887 so the hardware is still usable
next time we want to start it.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/p54/p54usb.c

index 44d6855bd17c586b09ecb6e2f0eb0b88e0a64eae..9539ddcf379ff08cedc0a2b93daf05594a97f425 100644 (file)
@@ -430,14 +430,16 @@ static const char p54u_firmware_upload_3887[] = "<\r";
 static int p54u_device_reset_3887(struct ieee80211_hw *dev)
 {
        struct p54u_priv *priv = dev->priv;
-       int ret, lock;
+       int ret, lock = (priv->intf->condition != USB_INTERFACE_BINDING);
        u8 buf[4];
 
-       ret = lock = usb_lock_device_for_reset(priv->udev, priv->intf);
-       if (ret < 0) {
-               dev_err(&priv->udev->dev, "(p54usb) unable to lock device for "
-                       "reset: %d\n", ret);
-               return ret;
+       if (lock) {
+               ret = usb_lock_device_for_reset(priv->udev, priv->intf);
+               if (ret < 0) {
+                       dev_err(&priv->udev->dev, "(p54usb) unable to lock "
+                               " device for reset: %d\n", ret);
+                       return ret;
+               }
        }
 
        ret = usb_reset_device(priv->udev);