Skip to contentSkip to conversation

usb: dwc3-meson-g12a: constify drvdata structs

PATCH In review Heiner Kallweit 2 participants 2 messages Mar 6, 2022 – Mar 7, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: dwc3-meson-g12a: constify drvdata structs

Constify the drvdata structs. This also matches the definition of member drvdata in dwc3_meson_g12a.

---
 drivers/usb/dwc3/dwc3-meson-g12a.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/usb/dwc3/dwc3-meson-g12a.c +5 -5
index bd814df3b..b282ad0e6 100644
@@ -188,7 +188,7 @@ static int dwc3_meson_gxl_usb_post_init(struct dwc3_meson_g12a *priv);
  * reset to recover usage of the port.
  */
 
-static struct dwc3_meson_g12a_drvdata gxl_drvdata = {
+static const struct dwc3_meson_g12a_drvdata gxl_drvdata = {
 	.otg_switch_supported = true,
 	.otg_phy_host_port_disable = true,
 	.clks = meson_gxl_clocks,
@@ -202,7 +202,7 @@ static struct dwc3_meson_g12a_drvdata gxl_drvdata = {
 	.usb_post_init = dwc3_meson_gxl_usb_post_init,
 };
 
-static struct dwc3_meson_g12a_drvdata gxm_drvdata = {
+static const struct dwc3_meson_g12a_drvdata gxm_drvdata = {
 	.otg_switch_supported = true,
 	.otg_phy_host_port_disable = true,
 	.clks = meson_gxl_clocks,
@@ -216,7 +216,7 @@ static struct dwc3_meson_g12a_drvdata gxm_drvdata = {
 	.usb_post_init = dwc3_meson_gxl_usb_post_init,
 };
 
-static struct dwc3_meson_g12a_drvdata axg_drvdata = {
+static const struct dwc3_meson_g12a_drvdata axg_drvdata = {
 	.otg_switch_supported = true,
 	.clks = meson_gxl_clocks,
 	.num_clks = ARRAY_SIZE(meson_gxl_clocks),
@@ -229,7 +229,7 @@ static struct dwc3_meson_g12a_drvdata axg_drvdata = {
 	.usb_post_init = dwc3_meson_gxl_usb_post_init,
 };
 
-static struct dwc3_meson_g12a_drvdata g12a_drvdata = {
+static const struct dwc3_meson_g12a_drvdata g12a_drvdata = {
 	.otg_switch_supported = true,
 	.clks = meson_g12a_clocks,
 	.num_clks = ARRAY_SIZE(meson_g12a_clocks),
@@ -241,7 +241,7 @@ static struct dwc3_meson_g12a_drvdata g12a_drvdata = {
 	.usb_init = dwc3_meson_g12a_usb_init,
 };
 
-static struct dwc3_meson_g12a_drvdata a1_drvdata = {
+static const struct dwc3_meson_g12a_drvdata a1_drvdata = {
 	.otg_switch_supported = false,
 	.clks = meson_a1_clocks,
 	.num_clks = ARRAY_SIZE(meson_a1_clocks),
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 49 lines · Heiner Kallweit

Constify the drvdata structs. This also matches the definition of member drvdata in dwc3_meson_g12a.

---
  drivers/usb/dwc3/dwc3-meson-g12a.c | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)
drivers/usb/dwc3/dwc3-meson-g12a.c +4 -4
index bd814df3b..b282ad0e6 100644
@@ -188,7 +188,7 @@ static int dwc3_meson_gxl_usb_post_init(struct dwc3_meson_g12a *priv);
   * reset to recover usage of the port.
   */
 
-static struct dwc3_meson_g12a_drvdata gxl_drvdata = {
+static const struct dwc3_meson_g12a_drvdata gxl_drvdata = {
  	.otg_switch_supported = true,
  	.otg_phy_host_port_disable = true,
  	.clks = meson_gxl_clocks,
@@ -202,7 +202,7 @@ static struct dwc3_meson_g12a_drvdata gxl_drvdata = {
  	.usb_post_init = dwc3_meson_gxl_usb_post_init,
  };
 
-static struct dwc3_meson_g12a_drvdata gxm_drvdata = {
+static const struct dwc3_meson_g12a_drvdata gxm_drvdata = {
  	.otg_switch_supported = true,
  	.otg_phy_host_port_disable = true,
  	.clks = meson_gxl_clocks,
@@ -216,7 +216,7 @@ static struct dwc3_meson_g12a_drvdata gxm_drvdata = {
  	.usb_post_init = dwc3_meson_gxl_usb_post_init,
  };
 
-static struct dwc3_meson_g12a_drvdata axg_drvdata = {
+static const struct dwc3_meson_g12a_drvdata axg_drvdata = {
  	.otg_switch_supported = true,
  	.clks = meson_gxl_clocks,
  	.num_clks = ARRAY_SIZE(meson_gxl_clocks),
@@ -229,7 +229,7 @@ static struct dwc3_meson_g12a_drvdata axg_drvdata = {
  	.usb_post_init = dwc3_meson_gxl_usb_post_init,
  };
 
-static struct dwc3_meson_g12a_drvdata g12a_drvdata = {
+static const struct dwc3_meson_g12a_drvdata g12a_drvdata = {
  	.otg_switch_supported = true,
  	.clks = meson_g12a_clocks,
  	.num_clks = ARRAY_SIZE(meson_g12a_clocks),

drivers/usb/dwc3/dwc3-meson-g12a.c static struct dwc3_meson_g12a_drvdata g12a_drvdata = { · line 247

Quoted 8 lines
drivers/usb/dwc3/dwc3-meson-g12a.c +1 -1
@@ -241,7 +241,7 @@ static struct dwc3_meson_g12a_drvdata g12a_drvdata = {
  	.usb_init = dwc3_meson_g12a_usb_init,
  };
 
-static struct dwc3_meson_g12a_drvdata a1_drvdata = {
+static const struct dwc3_meson_g12a_drvdata a1_drvdata = {
  	.otg_switch_supported = false,
  	.clks = meson_a1_clocks,
  	.num_clks = ARRAY_SIZE(meson_a1_clocks),

Looks good: