Skip to contentSkip to conversation

drm/msm/dsi: Remove use of device_node in dsi_host_parse_dt()

PATCH In review Nathan Chancellor 3 participants 3 messages Aug 29, 2022 – Aug 30, 2022

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

PATCH 1/1 drm/msm/dsi: Remove use of device_node in dsi_host_parse_dt()

Clang warns:

drivers/gpu/drm/msm/dsi/dsi_host.c:1903:14: error: variable 'device_node' is uninitialized when used here [-Werror,-Wuninitialized]

          of_node_put(device_node);
                      ^~~~~~~~~~~
  drivers/gpu/drm/msm/dsi/dsi_host.c:1870:44: note: initialize the variable 'device_node' to silence this warning
          struct device_node *endpoint, *device_node;
                                                    ^
                                                    = NULL

1 error generated.

device_node's assignment was removed but not all of its uses. Remove the call to of_node_put() and the variable declaration to clean up the warning.

Fixes 5f8cdece42ff ("drm/msm/dsi: switch to DRM_PANEL_BRIDGE")
---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/msm/dsi/dsi_host.c +1 -3
index 57a4c0fa614b..7fbf391c024f 100644
@@ -1867,7 +1867,7 @@ static int dsi_host_parse_dt(struct msm_dsi_host *msm_host)
 {
 	struct device *dev = &msm_host->pdev->dev;
 	struct device_node *np = dev->of_node;
-	struct device_node *endpoint, *device_node;
+	struct device_node *endpoint;
 	int ret = 0;
 
 	/*
@@ -1900,8 +1900,6 @@ static int dsi_host_parse_dt(struct msm_dsi_host *msm_host)
 		}
 	}
 
-	of_node_put(device_node);
-
 err:
 	of_node_put(endpoint);
 

base-commit: 5f8cdece42ff0c615e213b6619d29487f9f409d7

Signature · 1 line
2.37.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Nathan Chancellor

Clang warns:

   drivers/gpu/drm/msm/dsi/dsi_host.c:1903:14: error: variable 'device_node' is uninitialized when used here [-Werror,-Wuninitialized]
           of_node_put(device_node);
                       ^~~~~~~~~~~
   drivers/gpu/drm/msm/dsi/dsi_host.c:1870:44: note: initialize the variable 'device_node' to silence this warning
           struct device_node *endpoint, *device_node;
                                                     ^
                                                     = NULL
   1 error generated.
Quoted 7 lines

device_node's assignment was removed but not all of its uses. Remove the call to of_node_put() and the variable declaration to clean up the warning.

Fixes 5f8cdece42ff ("drm/msm/dsi: switch to DRM_PANEL_BRIDGE")
Quoted 28 lines
---
  drivers/gpu/drm/msm/dsi/dsi_host.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/msm/dsi/dsi_host.c +1 -3
index 57a4c0fa614b..7fbf391c024f 100644
@@ -1867,7 +1867,7 @@ static int dsi_host_parse_dt(struct msm_dsi_host *msm_host)
  {
  	struct device *dev = &msm_host->pdev->dev;
  	struct device_node *np = dev->of_node;
-	struct device_node *endpoint, *device_node;
+	struct device_node *endpoint;
  	int ret = 0;
 
  	/*
@@ -1900,8 +1900,6 @@ static int dsi_host_parse_dt(struct msm_dsi_host *msm_host)
  		}
  	}
 
-	of_node_put(device_node);
-
  err:
  	of_node_put(endpoint);
 

base-commit: 5f8cdece42ff0c615e213b6619d29487f9f409d7

Reviewed-by on v1 1/1
#2 lore raw
In reply to Nathan Chancellor
Quoted 11 lines · Nathan Chancellor

Clang warns:

   drivers/gpu/drm/msm/dsi/dsi_host.c:1903:14: error: variable 'device_node' is uninitialized when used here [-Werror,-Wuninitialized]
           of_node_put(device_node);
                       ^~~~~~~~~~~
   drivers/gpu/drm/msm/dsi/dsi_host.c:1870:44: note: initialize the variable 'device_node' to silence this warning
           struct device_node *endpoint, *device_node;
                                                     ^
                                                     = NULL
   1 error generated.
Quoted 7 lines

device_node's assignment was removed but not all of its uses. Remove the call to of_node_put() and the variable declaration to clean up the warning.

Fixes 5f8cdece42ff ("drm/msm/dsi: switch to DRM_PANEL_BRIDGE")
Signature · 2 lines
With best wishes
Dmitry