Skip to content

Commit c06c6ad

Browse files
committed
usb: device_next: do not list high-speed functions if not used
Do not add functions to the high-speed iterable section when high-speed support is disabled. Signed-off-by: Johann Fischer <[email protected]>
1 parent 2bc9c94 commit c06c6ad

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/zephyr/usb/usbd.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,10 +767,12 @@ static inline void *usbd_class_get_private(const struct usbd_class_data *const c
767767
usbd_class_fs, usbd_class_node, class_name##_fs) = { \
768768
.c_data = &class_name, \
769769
}; \
770+
IF_ENABLED(USBD_SPEED_HS, ( \
770771
static STRUCT_SECTION_ITERABLE_ALTERNATE( \
771772
usbd_class_hs, usbd_class_node, class_name##_hs) = { \
772773
.c_data = &class_name, \
773-
}
774+
} \
775+
))
774776

775777
/** @brief Helper to declare request table of usbd_cctx_vendor_req
776778
*

0 commit comments

Comments
 (0)