Skip to contentSkip to conversation

usb: dwc3: imx8mp: make dwc3_imx_glue_ops static and rename to imx8mp

PATCH Superseded Ben Dooks 3 participants 4 messages Jun 23

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

PATCH 1/1 usb: dwc3: imx8mp: make dwc3_imx_glue_ops static and rename to imx8mp

The dwc3_imx_glue_ops is not used outside this file, and technically this is the dwc3-imx8mp driver so whilst making this static to avoid the following warning, rename it dwc3_imx8mp_glue_ops to distinguish it from the other driver which also has dwc3_imx_glue_ops.

Fixes:
drivers/usb/dwc3/dwc3-imx8mp.c:176:22: warning: symbol 'dwc3_imx_glue_ops' was not declared. Should it be static?

---
 drivers/usb/dwc3/dwc3-imx8mp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/usb/dwc3/dwc3-imx8mp.c +3 -3
index 1cf96540b66e..bc61a89b66b1 100644
@@ -173,8 +173,8 @@ static void dwc3_imx_pre_set_role(struct dwc3 *dwc, enum usb_role role)
 		pm_runtime_use_autosuspend(dwc->dev);
 }
 
-struct dwc3_glue_ops dwc3_imx_glue_ops = {
-	.pre_set_role   = dwc3_imx_pre_set_role,
+statc struct dwc3_glue_ops dwc3_imx8mp_glue_ops = {
+	.pre_set_role   = dwc3_imx8mp_pre_set_role,
 };
 
 static int dwc3_imx8mp_probe(struct platform_device *pdev)
@@ -266,7 +266,7 @@ static int dwc3_imx8mp_probe(struct platform_device *pdev)
 		goto put_dwc3;
 	}
 
-	dwc3->glue_ops = &dwc3_imx_glue_ops;
+	dwc3->glue_ops = &dwc3_imx8mp_glue_ops;
 
 	if (dwc3->dr_mode == USB_DR_MODE_HOST)
 		pm_runtime_dont_use_autosuspend(dwc3->dev);
Signature · 1 line
2.37.2.352.g3c44437643
#1 lore raw
Quoted 18 lines · Ben Dooks

The dwc3_imx_glue_ops is not used outside this file, and technically this is the dwc3-imx8mp driver so whilst making this static to avoid the following warning, rename it dwc3_imx8mp_glue_ops to distinguish it from the other driver which also has dwc3_imx_glue_ops.

Fixes:
drivers/usb/dwc3/dwc3-imx8mp.c:176:22: warning: symbol 'dwc3_imx_glue_ops' was not declared. Should it be static?

---
 drivers/usb/dwc3/dwc3-imx8mp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/usb/dwc3/dwc3-imx8mp.c +0 -0
index 1cf96540b66e..bc61a89b66b1 100644

drivers/usb/dwc3/dwc3-imx8mp.c static void dwc3_imx_pre_set_role(struct dwc3 *dwc, enum usb_role role) · line 176

Quoted 6 lines
drivers/usb/dwc3/dwc3-imx8mp.c +1 -2
@@ -173,8 +173,8 @@ static void dwc3_imx_pre_set_role(struct dwc3 *dwc, enum usb_role role)
 		pm_runtime_use_autosuspend(dwc->dev);
 }
 
-struct dwc3_glue_ops dwc3_imx_glue_ops = {
-	.pre_set_role   = dwc3_imx_pre_set_role,
+statc struct dwc3_glue_ops dwc3_imx8mp_glue_ops = {

Typo

Quoted 13 lines
drivers/usb/dwc3/dwc3-imx8mp.c +2 -1
+	.pre_set_role   = dwc3_imx8mp_pre_set_role,
 };
 
 static int dwc3_imx8mp_probe(struct platform_device *pdev)
@@ -266,7 +266,7 @@ static int dwc3_imx8mp_probe(struct platform_device *pdev)
 		goto put_dwc3;
 	}
 
-	dwc3->glue_ops = &dwc3_imx_glue_ops;
+	dwc3->glue_ops = &dwc3_imx8mp_glue_ops;
 
 	if (dwc3->dr_mode == USB_DR_MODE_HOST)
 		pm_runtime_dont_use_autosuspend(dwc3->dev);
Signature · 4 lines
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |
author
#2 lore raw
Quoted 24 lines · Ahmad Fatoum
Quoted 21 lines · Ben Dooks

The dwc3_imx_glue_ops is not used outside this file, and technically this is the dwc3-imx8mp driver so whilst making this static to avoid the following warning, rename it dwc3_imx8mp_glue_ops to distinguish it from the other driver which also has dwc3_imx_glue_ops.

Fixes:
drivers/usb/dwc3/dwc3-imx8mp.c:176:22: warning: symbol 'dwc3_imx_glue_ops' was not declared. Should it be static?

---
  drivers/usb/dwc3/dwc3-imx8mp.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/usb/dwc3/dwc3-imx8mp.c +0 -0
index 1cf96540b66e..bc61a89b66b1 100644
@@ -173,8 +173,8 @@ static void dwc3_imx_pre_set_role(struct dwc3 *dwc, enum usb_role role)
  		pm_runtime_use_autosuspend(dwc->dev);
  }
 
Quoted 5 lines

drivers/usb/dwc3/dwc3-imx8mp.c static void dwc3_imx_pre_set_role(struct dwc3 *dwc, enum usb_role role) · line 176

Quoted 3 lines
drivers/usb/dwc3/dwc3-imx8mp.c +1 -2
-struct dwc3_glue_ops dwc3_imx_glue_ops = {
-	.pre_set_role   = dwc3_imx_pre_set_role,
+statc struct dwc3_glue_ops dwc3_imx8mp_glue_ops = {

Typo

Thanks, forgot to re-run check after this. Sent v2

Quoted 15 lines
Quoted 14 lines
drivers/usb/dwc3/dwc3-imx8mp.c +2 -1
+	.pre_set_role   = dwc3_imx8mp_pre_set_role,
  };
 
  static int dwc3_imx8mp_probe(struct platform_device *pdev)
@@ -266,7 +266,7 @@ static int dwc3_imx8mp_probe(struct platform_device *pdev)
  		goto put_dwc3;
  	}
 
-	dwc3->glue_ops = &dwc3_imx_glue_ops;
+	dwc3->glue_ops = &dwc3_imx8mp_glue_ops;
 
  	if (dwc3->dr_mode == USB_DR_MODE_HOST)
  		pm_runtime_dont_use_autosuspend(dwc3->dev);
Signature · 4 lines
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

https://www.codethink.co.uk/privacy.html
#3 lore raw
In reply to Ben Dooks
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Low] The keyword `static` is misspelled as `statc`, causing a compilation syntax error. - [Low] The…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Low] The keyword static is misspelled as statc, causing a compilation syntax error.
- [Low] The struct is initialized with the undeclared function dwc3_imx8mp_pre_set_role. --

commit 7c7aefb84ba9dd8d7379b9aae197107a91b20ee1
Author: Ben Dooks <[email protected]>

usb: dwc3: imx8mp: make dwc3_imx_glue_ops static and rename to imx8mp

This commit makes the dwc3_imx_glue_ops structure static to resolve a missing declaration warning. It also renames the structure to dwc3_imx8mp_glue_ops to distinguish it from other drivers.

drivers/usb/dwc3/dwc3-imx8mp.c static void dwc3_imx_pre_set_role(struct dwc3 *dwc, enum usb_role role) · line 176

Quoted 10 lines
drivers/usb/dwc3/dwc3-imx8mp.c +1 -2
@@ -173,8 +173,8 @@ static void dwc3_imx_pre_set_role(struct dwc3 *dwc, enum usb_role role)
 		pm_runtime_use_autosuspend(dwc->dev);
 }
 
-struct dwc3_glue_ops dwc3_imx_glue_ops = {
-	.pre_set_role   = dwc3_imx_pre_set_role,
+statc struct dwc3_glue_ops dwc3_imx8mp_glue_ops = {

[Severity: Low]
Does this cause a compilation error? It looks like the static keyword is misspelled as statc here.

drivers/usb/dwc3/dwc3-imx8mp.c static void dwc3_imx_pre_set_role(struct dwc3 *dwc, enum usb_role role) · line 177

Quoted 1 line
drivers/usb/dwc3/dwc3-imx8mp.c +1 -0
+	.pre_set_role   = dwc3_imx8mp_pre_set_role,

[Severity: Low]
Will this initialization also fail to compile? The structure is pointing to dwc3_imx8mp_pre_set_role, but earlier in the file the function remains named dwc3_imx_pre_set_role:

static void dwc3_imx_pre_set_role(struct dwc3 *dwc, enum usb_role role)

{
        ...

It seems the function renaming might have been left out of this patch.

Quoted 1 line
drivers/usb/dwc3/dwc3-imx8mp.c +0 -0
 };
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1