Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / input / joystick / iforce / iforce-usb.c
index 617c0b0..fe79d15 100644 (file)
@@ -134,28 +134,24 @@ static int iforce_usb_probe(struct usb_interface *intf,
        struct usb_host_interface *interface;
        struct usb_endpoint_descriptor *epirq, *epout;
        struct iforce *iforce;
+       int err = -ENOMEM;
 
        interface = intf->cur_altsetting;
 
        epirq = &interface->endpoint[0].desc;
        epout = &interface->endpoint[1].desc;
 
-       if (!(iforce = kmalloc(sizeof(struct iforce) + 32, GFP_KERNEL)))
+       if (!(iforce = kzalloc(sizeof(struct iforce) + 32, GFP_KERNEL)))
                goto fail;
 
-       memset(iforce, 0, sizeof(struct iforce));
-
-       if (!(iforce->irq = usb_alloc_urb(0, GFP_KERNEL))) {
+       if (!(iforce->irq = usb_alloc_urb(0, GFP_KERNEL)))
                goto fail;
-       }
 
-       if (!(iforce->out = usb_alloc_urb(0, GFP_KERNEL))) {
+       if (!(iforce->out = usb_alloc_urb(0, GFP_KERNEL)))
                goto fail;
-       }
 
-       if (!(iforce->ctrl = usb_alloc_urb(0, GFP_KERNEL))) {
+       if (!(iforce->ctrl = usb_alloc_urb(0, GFP_KERNEL)))
                goto fail;
-       }
 
        iforce->bus = IFORCE_USB;
        iforce->usbdev = dev;
@@ -173,7 +169,9 @@ static int iforce_usb_probe(struct usb_interface *intf,
        usb_fill_control_urb(iforce->ctrl, dev, usb_rcvctrlpipe(dev, 0),
                        (void*) &iforce->cr, iforce->edata, 16, iforce_usb_ctrl, iforce);
 
-       if (iforce_init_device(iforce)) goto fail;
+       err = iforce_init_device(iforce);
+       if (err)
+               goto fail;
 
        usb_set_intfdata(intf, iforce);
        return 0;
@@ -186,7 +184,7 @@ fail:
                kfree(iforce);
        }
 
-       return -ENODEV;
+       return err;
 }
 
 /* Called by iforce_delete() */
@@ -210,7 +208,7 @@ static void iforce_usb_disconnect(struct usb_interface *intf)
        usb_set_intfdata(intf, NULL);
        if (iforce) {
                iforce->usbdev = NULL;
-               input_unregister_device(&iforce->dev);
+               input_unregister_device(iforce->dev);
 
                if (!open) {
                        iforce_delete_device(iforce);
@@ -229,13 +227,13 @@ static struct usb_device_id iforce_usb_ids [] = {
        { USB_DEVICE(0x061c, 0xc0a4) },         /* ACT LABS Force RS */
        { USB_DEVICE(0x06f8, 0x0001) },         /* Guillemot Race Leader Force Feedback */
        { USB_DEVICE(0x06f8, 0x0004) },         /* Guillemot Force Feedback Racing Wheel */
+       { USB_DEVICE(0x06f8, 0xa302) },         /* Guillemot Jet Leader 3D */
        { }                                     /* Terminating entry */
 };
 
 MODULE_DEVICE_TABLE (usb, iforce_usb_ids);
 
 struct usb_driver iforce_usb_driver = {
-       .owner =        THIS_MODULE,
        .name =         "iforce",
        .probe =        iforce_usb_probe,
        .disconnect =   iforce_usb_disconnect,