[PATCH 3/3] usb: dwc3: generic: Staticize and constify driver ops

Marek Vasut marek.vasut+renesas at mailbox.org
Sun May 10 19:16:33 CEST 2026


Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
---
Cc: Balaji Selvanathan <balaji.selvanathan at oss.qualcomm.com>
Cc: Casey Connolly <casey.connolly at linaro.org>
Cc: Jonas Karlman <jonas at kwiboo.se>
Cc: Kaustabh Chakraborty <kauschluss at disroot.org>
Cc: Kever Yang <kever.yang at rock-chips.com>
Cc: Mattijs Korpershoek <mkorpershoek at kernel.org>
Cc: Sam Protsenko <semen.protsenko at linaro.org>
Cc: Tom Rini <trini at konsulko.com>
Cc: u-boot at lists.denx.de
---
 drivers/usb/dwc3/dwc3-generic.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
index 22b9ef0b24e..2356b3bc0aa 100644
--- a/drivers/usb/dwc3/dwc3-generic.c
+++ b/drivers/usb/dwc3/dwc3-generic.c
@@ -330,7 +330,7 @@ void dwc3_imx8mp_glue_configure(struct udevice *dev, int index,
 	unmap_physmem(base, MAP_NOCACHE);
 }
 
-struct dwc3_glue_ops imx8mp_ops = {
+static const struct dwc3_glue_ops imx8mp_ops = {
 	.glue_configure = dwc3_imx8mp_glue_configure,
 };
 
@@ -414,7 +414,7 @@ enum dwc3_omap_utmi_mode {
 	unmap_physmem(base, MAP_NOCACHE);
 }
 
-struct dwc3_glue_ops ti_ops = {
+static const struct dwc3_glue_ops ti_ops = {
 	.glue_configure = dwc3_ti_glue_configure,
 };
 
@@ -506,16 +506,16 @@ static int dwc3_flat_dt_get_ctrl_dev(struct udevice *dev, ofnode *node)
 	return 0;
 }
 
-struct dwc3_glue_ops qcom_ops = {
+static const struct dwc3_glue_ops qcom_ops = {
 	.glue_configure = dwc3_qcom_glue_configure,
 };
 
-struct dwc3_glue_ops qcom_flat_dt_ops = {
+static const struct dwc3_glue_ops qcom_flat_dt_ops = {
 	.glue_configure = dwc3_qcom_glue_configure,
 	.glue_get_ctrl_dev = dwc3_flat_dt_get_ctrl_dev,
 };
 
-struct dwc3_glue_ops rk_ops = {
+static const struct dwc3_glue_ops rk_ops = {
 	.glue_get_ctrl_dev = dwc3_flat_dt_get_ctrl_dev,
 };
 
-- 
2.53.0



More information about the U-Boot mailing list