From: Dmitry Torokhov Date: Wed, 21 Apr 2010 05:06:53 +0000 (-0700) Subject: Input: kbtab - simplify kbtab_disconnect() X-Git-Tag: upstream/snapshot3+hdmi~14139^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=331cb022d3ac1f85f7842a51495c33c629e947bc;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git Input: kbtab - simplify kbtab_disconnect() There is no need to check whether kbtab structure is attached to the interface; if it isn't and we are called we have much bigger problems. Also no need to call usb_kill_urb() in kbtab_disconnect() since it is being called in kbtab_close(). Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/tablet/kbtab.c b/drivers/input/tablet/kbtab.c index 76b5d52..3f7d125 100644 --- a/drivers/input/tablet/kbtab.c +++ b/drivers/input/tablet/kbtab.c @@ -193,13 +193,11 @@ static void kbtab_disconnect(struct usb_interface *intf) struct kbtab *kbtab = usb_get_intfdata(intf); usb_set_intfdata(intf, NULL); - if (kbtab) { - usb_kill_urb(kbtab->irq); - input_unregister_device(kbtab->dev); - usb_free_urb(kbtab->irq); - usb_buffer_free(interface_to_usbdev(intf), 8, kbtab->data, kbtab->data_dma); - kfree(kbtab); - } + + input_unregister_device(kbtab->dev); + usb_free_urb(kbtab->irq); + usb_buffer_free(kbtab->usbdev, 8, kbtab->data, kbtab->data_dma); + kfree(kbtab); } static struct usb_driver kbtab_driver = {