Skip to contentSkip to conversation

mdp5: Return error values from mdp5_cfg_init

PATCH In review Will Newton 2 participants 2 messages Nov 30, 2017 – Dec 4, 2017 1 message not in the archive

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

PATCH 1/1 mdp5: Return error values from mdp5_cfg_init

The return value of this function is a pointer checked with IS_ERR, so we should be returning an error pointer rather than NULL when the init fails.

---
 drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c +1 -1
index 824067d2d427..42f0ecb0cf35 100644
@@ -635,7 +635,7 @@ struct mdp5_cfg_handler *mdp5_cfg_init(struct mdp5_kms *mdp5_kms,
 	if (cfg_handler)
 		mdp5_cfg_destroy(cfg_handler);
 
-	return NULL;
+	return ERR_PTR(ret);
 }
 
 static struct mdp5_cfg_platform *mdp5_get_config(struct platform_device *dev)
Signature · 1 line
2.14.3

A message that is not in the archive (sent off-list or not yet received): 20171130210416.8229-1-will.newton-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

Reviewed-by
#2 lore raw
Quoted 3 lines · Will Newton

The return value of this function is a pointer checked with IS_ERR, so we should be returning an error pointer rather than NULL when the init fails.

Quoted 20 lines
---
  drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c +1 -1
index 824067d2d427..42f0ecb0cf35 100644
@@ -635,7 +635,7 @@ struct mdp5_cfg_handler *mdp5_cfg_init(struct mdp5_kms *mdp5_kms,
  	if (cfg_handler)
  		mdp5_cfg_destroy(cfg_handler);
 
-	return NULL;
+	return ERR_PTR(ret);
  }
 
  static struct mdp5_cfg_platform *mdp5_get_config(struct platform_device *dev)
Signature · 6 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno