Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 331cb022 authored by Dmitry Torokhov's avatar Dmitry Torokhov
Browse files

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: default avatarDmitry Torokhov <dtor@mail.ru>
parent ee7aa6ce
Loading
Loading
Loading
Loading
+5 −7
Original line number Original line Diff line number Diff line
@@ -193,14 +193,12 @@ static void kbtab_disconnect(struct usb_interface *intf)
	struct kbtab *kbtab = usb_get_intfdata(intf);
	struct kbtab *kbtab = usb_get_intfdata(intf);


	usb_set_intfdata(intf, NULL);
	usb_set_intfdata(intf, NULL);
	if (kbtab) {

		usb_kill_urb(kbtab->irq);
	input_unregister_device(kbtab->dev);
	input_unregister_device(kbtab->dev);
	usb_free_urb(kbtab->irq);
	usb_free_urb(kbtab->irq);
		usb_buffer_free(interface_to_usbdev(intf), 8, kbtab->data, kbtab->data_dma);
	usb_buffer_free(kbtab->usbdev, 8, kbtab->data, kbtab->data_dma);
	kfree(kbtab);
	kfree(kbtab);
}
}
}


static struct usb_driver kbtab_driver = {
static struct usb_driver kbtab_driver = {
	.name =		"kbtab",
	.name =		"kbtab",