Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 227086
b: refs/heads/master
c: 2a05915
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Torokhov committed Nov 12, 2010
1 parent e0e25ab commit 75fd3ce
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 161feb2417dd0c4324c2e8da24aaebd30a436d45
refs/heads/master: 2a0591596b302adc654a1caf6bd3d0063407ea4b
37 changes: 18 additions & 19 deletions trunk/drivers/input/joystick/xpad.c
Original file line number Diff line number Diff line change
Expand Up @@ -993,22 +993,24 @@ static void xpad_disconnect(struct usb_interface *intf)
{
struct usb_xpad *xpad = usb_get_intfdata (intf);

usb_set_intfdata(intf, NULL);
if (xpad) {
xpad_led_disconnect(xpad);
input_unregister_device(xpad->dev);
xpad_deinit_output(xpad);
if (xpad->xtype == XTYPE_XBOX360W) {
usb_kill_urb(xpad->bulk_out);
usb_free_urb(xpad->bulk_out);
usb_kill_urb(xpad->irq_in);
}
usb_free_urb(xpad->irq_in);
usb_free_coherent(xpad->udev, XPAD_PKT_LEN,
xpad->idata, xpad->idata_dma);
kfree(xpad->bdata);
kfree(xpad);
xpad_led_disconnect(xpad);
input_unregister_device(xpad->dev);
xpad_deinit_output(xpad);

if (xpad->xtype == XTYPE_XBOX360W) {
usb_kill_urb(xpad->bulk_out);
usb_free_urb(xpad->bulk_out);
usb_kill_urb(xpad->irq_in);
}

usb_free_urb(xpad->irq_in);
usb_free_coherent(xpad->udev, XPAD_PKT_LEN,
xpad->idata, xpad->idata_dma);

kfree(xpad->bdata);
kfree(xpad);

usb_set_intfdata(intf, NULL);
}

static struct usb_driver xpad_driver = {
Expand All @@ -1020,10 +1022,7 @@ static struct usb_driver xpad_driver = {

static int __init usb_xpad_init(void)
{
int result = usb_register(&xpad_driver);
if (result == 0)
printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC "\n");
return result;
return usb_register(&xpad_driver);
}

static void __exit usb_xpad_exit(void)
Expand Down

0 comments on commit 75fd3ce

Please sign in to comment.