Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: gadget: f_hid: remove compatibility layer

There are no old function interface users left, so remove it.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>

authored by

Andrzej Pietrasiewicz and committed by
Felipe Balbi
5d66a391 4bc8a33f

-73
-73
drivers/usb/gadget/function/f_hid.c
··· 28 28 29 29 static int major, minors; 30 30 static struct class *hidg_class; 31 - #ifndef USBF_HID_INCLUDED 32 31 static DEFINE_IDA(hidg_ida); 33 32 static DEFINE_MUTEX(hidg_ida_lock); /* protects access to hidg_ida */ 34 - #endif 35 33 36 34 /*-------------------------------------------------------------------------*/ 37 35 /* HID gadget struct */ ··· 682 684 return status; 683 685 } 684 686 685 - #ifdef USBF_HID_INCLUDED 686 - static void hidg_unbind(struct usb_configuration *c, struct usb_function *f) 687 - { 688 - struct f_hidg *hidg = func_to_hidg(f); 689 - 690 - device_destroy(hidg_class, MKDEV(major, hidg->minor)); 691 - cdev_del(&hidg->cdev); 692 - 693 - /* disable/free request and end point */ 694 - usb_ep_disable(hidg->in_ep); 695 - usb_ep_dequeue(hidg->in_ep, hidg->req); 696 - kfree(hidg->req->buf); 697 - usb_ep_free_request(hidg->in_ep, hidg->req); 698 - 699 - usb_free_all_descriptors(f); 700 - 701 - kfree(hidg->report_desc); 702 - kfree(hidg); 703 - } 704 - 705 - /*-------------------------------------------------------------------------*/ 706 - /* usb_configuration */ 707 - int __init hidg_bind_config(struct usb_configuration *c, 708 - struct hidg_func_descriptor *fdesc, int index) 709 - { 710 - struct f_hidg *hidg; 711 - int status; 712 - 713 - if (index >= minors) 714 - return -ENOENT; 715 - 716 - /* allocate and initialize one new instance */ 717 - hidg = kzalloc(sizeof *hidg, GFP_KERNEL); 718 - if (!hidg) 719 - return -ENOMEM; 720 - 721 - hidg->minor = index; 722 - hidg->bInterfaceSubClass = fdesc->subclass; 723 - hidg->bInterfaceProtocol = fdesc->protocol; 724 - hidg->report_length = fdesc->report_length; 725 - hidg->report_desc_length = fdesc->report_desc_length; 726 - hidg->report_desc = kmemdup(fdesc->report_desc, 727 - fdesc->report_desc_length, 728 - GFP_KERNEL); 729 - if (!hidg->report_desc) { 730 - kfree(hidg); 731 - return -ENOMEM; 732 - } 733 - 734 - hidg->func.name = "hid"; 735 - hidg->func.strings = ct_func_strings; 736 - hidg->func.bind = hidg_bind; 737 - hidg->func.unbind = hidg_unbind; 738 - hidg->func.set_alt = hidg_set_alt; 739 - hidg->func.disable = hidg_disable; 740 - hidg->func.setup = hidg_setup; 741 - 742 - /* this could me made configurable at some point */ 743 - hidg->qlen = 4; 744 - 745 - status = usb_add_function(c, &hidg->func); 746 - if (status) 747 - kfree(hidg); 748 - 749 - return status; 750 - } 751 - 752 - #else 753 - 754 687 static inline int hidg_get_minor(void) 755 688 { 756 689 int ret; ··· 823 894 DECLARE_USB_FUNCTION_INIT(hid, hidg_alloc_inst, hidg_alloc); 824 895 MODULE_LICENSE("GPL"); 825 896 MODULE_AUTHOR("Fabien Chouteau"); 826 - 827 - #endif 828 897 829 898 int ghid_setup(struct usb_gadget *g, int count) 830 899 {