Skip to content

Commit

Permalink
usb: device: class: gs_usb: get rid of "on-bus" devicetree requirement
Browse files Browse the repository at this point in the history
Get rid of the "on-bus: usb" devicetree requirement to match upstream
Zephyr USB class devicetree bindings.

Signed-off-by: Henrik Brix Andersen <[email protected]>
  • Loading branch information
henrikbrixandersen committed Feb 10, 2025
1 parent 4e6074d commit 5f5cc04
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 20 deletions.
4 changes: 2 additions & 2 deletions app/app.overlay
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* Copyright (c) 2022-2024 Henrik Brix Andersen <[email protected]>
* Copyright (c) 2022-2025 Henrik Brix Andersen <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

&zephyr_udc0 {
/ {
gs_usb0: gs_usb0 {
compatible = "gs_usb";
label = "gs_usb";
Expand Down
4 changes: 1 addition & 3 deletions dts/bindings/usb/gs_usb.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2022-2024 Henrik Brix Andersen <[email protected]>
# Copyright (c) 2022-2025 Henrik Brix Andersen <[email protected]>
# SPDX-License-Identifier: Apache-2.0

description: Geschwister Schneider USB/CAN
Expand All @@ -7,8 +7,6 @@ compatible: "gs_usb"

include: base.yaml

on-bus: usb

properties:
label:
description: |
Expand Down
6 changes: 1 addition & 5 deletions subsys/usb/device/class/gs_usb.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2024 Henrik Brix Andersen <[email protected]>
* Copyright (c) 2022-2025 Henrik Brix Andersen <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -1515,10 +1515,6 @@ static int gs_usb_init(const struct device *dev)
}

#define GS_USB_DEVICE_DEFINE(inst) \
BUILD_ASSERT(DT_INST_ON_BUS(inst, usb), \
"node " DT_NODE_PATH( \
DT_DRV_INST(inst)) " is not assigned to a USB device controller"); \
\
NET_BUF_POOL_FIXED_DEFINE(gs_usb_pool_##inst, CONFIG_USB_DEVICE_GS_USB_POOL_SIZE, \
GS_USB_HOST_FRAME_MAX_SIZE, 0, NULL); \
\
Expand Down
6 changes: 1 addition & 5 deletions subsys/usb/device_next/class/gs_usb.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2024 Henrik Brix Andersen <[email protected]>
* Copyright (c) 2022-2025 Henrik Brix Andersen <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -1727,10 +1727,6 @@ struct usbd_class_api gs_usb_api = {
}

#define USBD_GS_USB_DT_DEVICE_DEFINE(n) \
BUILD_ASSERT(DT_INST_ON_BUS(n, usb), \
"node " DT_NODE_PATH( \
DT_DRV_INST(n)) " is not assigned to a USB device controller"); \
\
GS_USB_DEFINE_DESCRIPTOR(n); \
\
USBD_DEFINE_CLASS(gs_usb_##n, &gs_usb_api, (void *)DEVICE_DT_GET(DT_DRV_INST(n)), \
Expand Down
4 changes: 2 additions & 2 deletions tests/subsys/usb/gs_usb/cxx/app.overlay
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* Copyright (c) 2024 Henrik Brix Andersen <[email protected]>
* Copyright (c) 2024-2025 Henrik Brix Andersen <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

&zephyr_udc0 {
/ {
gs_usb0: gs_usb0 {
compatible = "gs_usb";
};
Expand Down
4 changes: 1 addition & 3 deletions tests/subsys/usb/gs_usb/host/app.overlay
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2024 Henrik Brix Andersen <[email protected]>
* Copyright (c) 2022-2025 Henrik Brix Andersen <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -24,9 +24,7 @@
status = "okay";
compatible = "zephyr,can-loopback";
};
};

&zephyr_udc0 {
gs_usb0: gs_usb0 {
compatible = "gs_usb";
};
Expand Down

0 comments on commit 5f5cc04

Please sign in to comment.