usb: gadget: composite: Show warning if function driver's descriptors are incomplete.
authorQihang Hu <huqihang@oppo.com>
Wed, 10 Nov 2021 10:11:29 +0000 (18:11 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Nov 2021 13:41:02 +0000 (14:41 +0100)
commit16d42759207fc3d1bff7cfd330a08a225e470ba0
tree7cc20edd8ff18fb7e13c72e7957dc1620ea38a15
parentd429976170a5699ef2cc03e3e3abfc06098754cc
usb: gadget: composite: Show warning if function driver's descriptors are incomplete.

In the config_ep_by_speed_and_alt function, select the corresponding
descriptor through g->speed. But some legacy or not well designed
function drivers may not support the corresponding speed. So, we can
directly display warnings instead of causing kernel panic. At the
same time, it indicates the reasons in warning message.

Reviewed-by: Peter Chen <peter.chen@kernel.org>
Signed-off-by: Qihang Hu <huqihang@oppo.com>
Link: https://lore.kernel.org/r/20211110101129.462357-1-huqihang@oppo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/composite.c