Skip to contentSkip to conversation

drm/bridge: of-display-mode-bridge: Fix missing static const for the bridge funcs

PATCH Applied Damon Ding 3 participants 4 messages Jun 17 – Jun 26

Subsystems (3)
lore
Share & tools
lore

Damon Ding

author
#0 lore raw

PATCH 1/1 drm/bridge: of-display-mode-bridge: Fix missing static const for the bridge funcs

Add static qualifier for of_display_mode_bridge_funcs to resolve the sparse warning:

drivers/gpu/drm/bridge/of-display-mode-bridge.c:54:25: sparse: sparse:
symbol 'of_display_mode_bridge_funcs' was not declared. Should it be static?

Also mark the structure const as required by devm_drm_bridge_alloc() parameter type constraints.

Fixes ba2db93cf3d5 ("drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use")
---
 drivers/gpu/drm/bridge/of-display-mode-bridge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/of-display-mode-bridge.c +1 -1
index cb15713f3a79..e66dae168fd0 100644
@@ -51,7 +51,7 @@ static int of_display_mode_bridge_get_modes(struct drm_bridge *bridge,
 	return 0;
 }
 
-struct drm_bridge_funcs of_display_mode_bridge_funcs = {
+static const struct drm_bridge_funcs of_display_mode_bridge_funcs = {
 	.attach = of_display_mode_bridge_attach,
 	.get_modes = of_display_mode_bridge_get_modes,
 };
Signature · 1 line
2.34.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Damon Ding

Add static qualifier for of_display_mode_bridge_funcs to resolve the sparse warning:

drivers/gpu/drm/bridge/of-display-mode-bridge.c:54:25: sparse: sparse:
symbol 'of_display_mode_bridge_funcs' was not declared. Should it be static?

Quoted 7 lines

Also mark the structure const as required by devm_drm_bridge_alloc() parameter type constraints.

Fixes ba2db93cf3d5 ("drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use")
Quoted 17 lines
---
 drivers/gpu/drm/bridge/of-display-mode-bridge.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/of-display-mode-bridge.c +1 -1
index cb15713f3a79..e66dae168fd0 100644
@@ -51,7 +51,7 @@ static int of_display_mode_bridge_get_modes(struct drm_bridge *bridge,
 	return 0;
 }
 
-struct drm_bridge_funcs of_display_mode_bridge_funcs = {
+static const struct drm_bridge_funcs of_display_mode_bridge_funcs = {
 	.attach = of_display_mode_bridge_attach,
 	.get_modes = of_display_mode_bridge_get_modes,
 };
Signature · 3 lines
Regards,

Laurent Pinchart
reviewer Applied
#3 lore raw
In reply to Damon Ding
Quoted 8 lines · Damon Ding

Add static qualifier for of_display_mode_bridge_funcs to resolve the sparse warning:

drivers/gpu/drm/bridge/of-display-mode-bridge.c:54:25: sparse: sparse:
symbol 'of_display_mode_bridge_funcs' was not declared. Should it be static?

[...]

Applied, thanks!

[1/1] drm/bridge: of-display-mode-bridge: Fix missing static const for the bridge funcs

      commit: 6648301c5bb2ef23f0fb15bcb01d21ff66f36799

Best regards,

Signature · 3 lines
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com