Commit 2a059159 authored by Dmitry Torokhov's avatar Dmitry Torokhov

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: default avatarDmitry Torokhov <dtor@mail.ru>
parent 161feb24
...@@ -993,22 +993,24 @@ static void xpad_disconnect(struct usb_interface *intf) ...@@ -993,22 +993,24 @@ static void xpad_disconnect(struct usb_interface *intf)
{ {
struct usb_xpad *xpad = usb_get_intfdata (intf); struct usb_xpad *xpad = usb_get_intfdata (intf);
usb_set_intfdata(intf, NULL); xpad_led_disconnect(xpad);
if (xpad) { input_unregister_device(xpad->dev);
xpad_led_disconnect(xpad); xpad_deinit_output(xpad);
input_unregister_device(xpad->dev);
xpad_deinit_output(xpad); if (xpad->xtype == XTYPE_XBOX360W) {
if (xpad->xtype == XTYPE_XBOX360W) { usb_kill_urb(xpad->bulk_out);
usb_kill_urb(xpad->bulk_out); usb_free_urb(xpad->bulk_out);
usb_free_urb(xpad->bulk_out); usb_kill_urb(xpad->irq_in);
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_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 = { static struct usb_driver xpad_driver = {
...@@ -1020,10 +1022,7 @@ static struct usb_driver xpad_driver = { ...@@ -1020,10 +1022,7 @@ static struct usb_driver xpad_driver = {
static int __init usb_xpad_init(void) static int __init usb_xpad_init(void)
{ {
int result = usb_register(&xpad_driver); return usb_register(&xpad_driver);
if (result == 0)
printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC "\n");
return result;
} }
static void __exit usb_xpad_exit(void) static void __exit usb_xpad_exit(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment