Input: iforce - minor clean-ups
authorJohann Deneux <johann.deneux@gmail.com>
Mon, 14 May 2007 04:09:33 +0000 (00:09 -0400)
committerDmitry Torokhov <dtor@insightbb.com>
Wed, 23 May 2007 03:23:30 +0000 (23:23 -0400)
Signed-off-by: Johann Deneux <johann.deneux@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/joystick/iforce/iforce-main.c
drivers/input/joystick/iforce/iforce-packets.c

index fb129c479a666124670bfba0652f01ba66fb5ba2..682244b1c0422610e9475020d83f67cb7fff51e4 100644 (file)
@@ -370,10 +370,8 @@ int iforce_init_device(struct iforce *iforce)
 
 /*
  * Disable spring, enable force feedback.
- * FIXME: We should use iforce_set_autocenter() et al here.
  */
-
-       iforce_send_packet(iforce, FF_CMD_AUTOCENTER, "\004\000");
+       iforce_set_autocenter(input_dev, 0);
 
 /*
  * Find appropriate device entry
index 21c4e13d3a508c15e17c50d2b6b453aed7fcf5f4..3154ccd7400098d1110fca740ed8156bb2a7eb32 100644 (file)
@@ -246,6 +246,8 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data)
 
 int iforce_get_id_packet(struct iforce *iforce, char *packet)
 {
+       int status;
+
        switch (iforce->bus) {
 
        case IFORCE_USB:
@@ -254,18 +256,22 @@ int iforce_get_id_packet(struct iforce *iforce, char *packet)
                iforce->cr.bRequest = packet[0];
                iforce->ctrl->dev = iforce->usbdev;
 
-               if (usb_submit_urb(iforce->ctrl, GFP_ATOMIC))
+               status = usb_submit_urb(iforce->ctrl, GFP_ATOMIC);
+               if (status) {
+                       err("usb_submit_urb failed %d", status);
                        return -1;
+               }
 
                wait_event_interruptible_timeout(iforce->wait,
                        iforce->ctrl->status != -EINPROGRESS, HZ);
 
                if (iforce->ctrl->status) {
+                       dbg("iforce->ctrl->status = %d", iforce->ctrl->status);
                        usb_unlink_urb(iforce->ctrl);
                        return -1;
                }
 #else
-               err("iforce_get_id_packet: iforce->bus = USB!");
+               dbg("iforce_get_id_packet: iforce->bus = USB!");
 #endif
                break;