Browse Source

Input: iforce - fix detection of USB devices

Recent conversion to wait_event_interruptible_timeout() caused
USB detection routine erroneously report timeouts for perfectly
working devices.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Dmitry Torokhov 19 years ago
parent
commit
97d4ebfe79

+ 2 - 2
drivers/input/joystick/iforce/iforce-packets.c

@@ -167,9 +167,9 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data,
 		iforce->expect_packet = 0;
 		iforce->expect_packet = 0;
 		iforce->ecmd = cmd;
 		iforce->ecmd = cmd;
 		memcpy(iforce->edata, data, IFORCE_MAX_LENGTH);
 		memcpy(iforce->edata, data, IFORCE_MAX_LENGTH);
-		wake_up(&iforce->wait);
 	}
 	}
 #endif
 #endif
+	wake_up(&iforce->wait);
 
 
 	if (!iforce->type) {
 	if (!iforce->type) {
 		being_used--;
 		being_used--;
@@ -264,7 +264,7 @@ int iforce_get_id_packet(struct iforce *iforce, char *packet)
 		wait_event_interruptible_timeout(iforce->wait,
 		wait_event_interruptible_timeout(iforce->wait,
 			iforce->ctrl->status != -EINPROGRESS, HZ);
 			iforce->ctrl->status != -EINPROGRESS, HZ);
 
 
-		if (iforce->ctrl->status != -EINPROGRESS) {
+		if (iforce->ctrl->status) {
 			usb_unlink_urb(iforce->ctrl);
 			usb_unlink_urb(iforce->ctrl);
 			return -1;
 			return -1;
 		}
 		}

+ 0 - 1
drivers/input/joystick/iforce/iforce-usb.c

@@ -95,7 +95,6 @@ static void iforce_usb_irq(struct urb *urb, struct pt_regs *regs)
 		goto exit;
 		goto exit;
 	}
 	}
 
 
-	wake_up(&iforce->wait);
 	iforce_process_packet(iforce,
 	iforce_process_packet(iforce,
 		(iforce->data[0] << 8) | (urb->actual_length - 1), iforce->data + 1, regs);
 		(iforce->data[0] << 8) | (urb->actual_length - 1), iforce->data + 1, regs);