X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Finput%2Fjoystick%2Fiforce%2Fiforce-usb.c;h=64b4a308098521ee6d01cc6893a4e938759aa6a3;hb=17dd3f0f7aa729a042af5d3318ff9b3e7781b45b;hp=6369a24684fe35eb1d25ed98a384c902197ad76b;hpb=62778ba1aa2589dc78c36a32edc6f5a6ccaf50c6;p=powerpc.git diff --git a/drivers/input/joystick/iforce/iforce-usb.c b/drivers/input/joystick/iforce/iforce-usb.c index 6369a24684..64b4a30809 100644 --- a/drivers/input/joystick/iforce/iforce-usb.c +++ b/drivers/input/joystick/iforce/iforce-usb.c @@ -95,6 +95,7 @@ static void iforce_usb_irq(struct urb *urb, struct pt_regs *regs) goto exit; } + wake_up(&iforce->wait); iforce_process_packet(iforce, (iforce->data[0] << 8) | (urb->actual_length - 1), iforce->data + 1, regs); @@ -134,28 +135,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 +170,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 +185,7 @@ fail: kfree(iforce); } - return -ENODEV; + return err; } /* Called by iforce_delete() */ @@ -210,7 +209,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);