diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-11-11 21:52:18 -0800 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-11-11 22:02:27 -0800 |
commit | 2a0591596b302adc654a1caf6bd3d0063407ea4b (patch) | |
tree | 62f649534487d2978ec22219470a8db4288fcf41 /drivers/input/joystick | |
parent | 161feb2417dd0c4324c2e8da24aaebd30a436d45 (diff) |
Input: xpad - remove useless check in xpad_remove
ixpad can never be NULL here; if it is NULL we would not have been bound to
the interface and then why would we be called?
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/joystick')
-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) { 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 = { @@ -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) |