diff options
Diffstat (limited to 'drivers/input/joystick/xpad.c')
-rw-r--r-- | drivers/input/joystick/xpad.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index 5fce72433932..4875de9a3f88 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c | |||
@@ -993,22 +993,24 @@ static void xpad_disconnect(struct usb_interface *intf) | |||
993 | { | 993 | { |
994 | struct usb_xpad *xpad = usb_get_intfdata (intf); | 994 | struct usb_xpad *xpad = usb_get_intfdata (intf); |
995 | 995 | ||
996 | usb_set_intfdata(intf, NULL); | 996 | xpad_led_disconnect(xpad); |
997 | if (xpad) { | 997 | input_unregister_device(xpad->dev); |
998 | xpad_led_disconnect(xpad); | 998 | xpad_deinit_output(xpad); |
999 | input_unregister_device(xpad->dev); | 999 | |
1000 | xpad_deinit_output(xpad); | 1000 | if (xpad->xtype == XTYPE_XBOX360W) { |
1001 | if (xpad->xtype == XTYPE_XBOX360W) { | 1001 | usb_kill_urb(xpad->bulk_out); |
1002 | usb_kill_urb(xpad->bulk_out); | 1002 | usb_free_urb(xpad->bulk_out); |
1003 | usb_free_urb(xpad->bulk_out); | 1003 | usb_kill_urb(xpad->irq_in); |
1004 | usb_kill_urb(xpad->irq_in); | ||
1005 | } | ||
1006 | usb_free_urb(xpad->irq_in); | ||
1007 | usb_free_coherent(xpad->udev, XPAD_PKT_LEN, | ||
1008 | xpad->idata, xpad->idata_dma); | ||
1009 | kfree(xpad->bdata); | ||
1010 | kfree(xpad); | ||
1011 | } | 1004 | } |
1005 | |||
1006 | usb_free_urb(xpad->irq_in); | ||
1007 | usb_free_coherent(xpad->udev, XPAD_PKT_LEN, | ||
1008 | xpad->idata, xpad->idata_dma); | ||
1009 | |||
1010 | kfree(xpad->bdata); | ||
1011 | kfree(xpad); | ||
1012 | |||
1013 | usb_set_intfdata(intf, NULL); | ||
1012 | } | 1014 | } |
1013 | 1015 | ||
1014 | static struct usb_driver xpad_driver = { | 1016 | static struct usb_driver xpad_driver = { |
@@ -1020,10 +1022,7 @@ static struct usb_driver xpad_driver = { | |||
1020 | 1022 | ||
1021 | static int __init usb_xpad_init(void) | 1023 | static int __init usb_xpad_init(void) |
1022 | { | 1024 | { |
1023 | int result = usb_register(&xpad_driver); | 1025 | return usb_register(&xpad_driver); |
1024 | if (result == 0) | ||
1025 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC "\n"); | ||
1026 | return result; | ||
1027 | } | 1026 | } |
1028 | 1027 | ||
1029 | static void __exit usb_xpad_exit(void) | 1028 | static void __exit usb_xpad_exit(void) |