Skip to content

Commit 635a006

Browse files
jfischer-nodkalowsk
authored andcommitted
usb: device_next: bt_hci: drop high-speed descriptors table if not used
If high-speed is not supported, drop the high-speed descriptors table. Signed-off-by: Johann Fischer <[email protected]>
1 parent d2e42c9 commit 635a006

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

subsys/usb/device_next/class/bt_hci.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ const static struct usb_desc_header *bt_hci_fs_desc_##n[] = { \
635635
(struct usb_desc_header *) &bt_hci_desc_##n.nil_desc, \
636636
}; \
637637
\
638-
const static struct usb_desc_header *bt_hci_hs_desc_##n[] = { \
638+
const static __maybe_unused struct usb_desc_header *bt_hci_hs_desc_##n[] = { \
639639
(struct usb_desc_header *) &bt_hci_desc_##n.iad, \
640640
(struct usb_desc_header *) &bt_hci_desc_##n.if0, \
641641
(struct usb_desc_header *) &bt_hci_desc_##n.if0_int_ep, \
@@ -655,7 +655,8 @@ const static struct usb_desc_header *bt_hci_hs_desc_##n[] = { \
655655
.sync_sem = Z_SEM_INITIALIZER(bt_hci_data_##n.sync_sem, 0, 1), \
656656
.desc = &bt_hci_desc_##n, \
657657
.fs_desc = bt_hci_fs_desc_##n, \
658-
.hs_desc = bt_hci_hs_desc_##n, \
658+
.hs_desc = COND_CODE_1(USBD_SUPPORTS_HIGH_SPEED, \
659+
(bt_hci_hs_desc_##n), (NULL)), \
659660
}; \
660661
\
661662
USBD_DEFINE_CLASS(bt_hci_##n, &bt_hci_api, \

0 commit comments

Comments
 (0)