usb: gadget: unconditionally allocate hs/ss descriptor in bind operation
authorLinyu Yuan <quic_linyyuan@quicinc.com>
Thu, 3 Aug 2023 09:10:50 +0000 (17:10 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Aug 2023 12:48:33 +0000 (14:48 +0200)
commit46decc82ffd54212cc2c600031daec6e835a6503
treeaff1237131aca7c568a74ec17f479aa81dd77dc0
parent3c5b006f3ee800b4bd9ed37b3a8f271b8560126e
usb: gadget: unconditionally allocate hs/ss descriptor in bind operation

Take f_midi_bind() for example,  when composite layer call it, it will
allocate hs descriptor by calling gadget_is_dualspeed() API to check
gadget max support speed capability, but most other gadget function didn't
do like this.

To follow other function drivers, it is safe to remove the check which
mean support all possible link speed by default in function driver.

Similar change apply to midi2 and uvc.

Also in midi and midi2, as there is no descriptor difference between
super speed and super speed plus, follow other gadget function drivers,
do not allocate descriptor for super speed plus, composite layer will
handle it properly.

Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
Link: https://lore.kernel.org/r/20230803091053.9714-5-quic_linyyuan@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/f_midi.c
drivers/usb/gadget/function/f_midi2.c
drivers/usb/gadget/function/f_uvc.c