Skip to content

Commit ec851ba

Browse files
jfischer-nokartben
authored andcommitted
usb: device_next: avoid false error logging in CDC ACM
The interface descriptor and its associated string descriptor are shared between different speed configurations. Do not try to add a string descriptor if it has already been added and the index is not zero. Signed-off-by: Johann Fischer <[email protected]>
1 parent 53c3f34 commit ec851ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/usb/device_next/class/usbd_cdc_acm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ static int usbd_cdc_acm_init(struct usbd_class_data *const c_data)
506506
desc->if0_union.bControlInterface = desc->if0.bInterfaceNumber;
507507
desc->if0_union.bSubordinateInterface0 = desc->if1.bInterfaceNumber;
508508

509-
if (cfg->if_desc_data != NULL) {
509+
if (cfg->if_desc_data != NULL && desc->if0.iInterface == 0) {
510510
if (usbd_add_descriptor(uds_ctx, cfg->if_desc_data)) {
511511
LOG_ERR("Failed to add interface string descriptor");
512512
} else {

0 commit comments

Comments
 (0)