summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/dp/dp_debug.c
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2021-12-22 22:33:47 +0300
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>2022-02-18 18:32:57 +0300
commit31e0889daa4b8fcfd785a71b5f323015d67ad037 (patch)
tree8ee8d97abcf3f035c7a5f5935d2a6cb98eee51d3 /drivers/gpu/drm/msm/dp/dp_debug.c
parent74222b7c4214c9bfb915508ad4691d9127555ef5 (diff)
downloadlinux-31e0889daa4b8fcfd785a71b5f323015d67ad037.tar.xz
drm/msm/dp: Simplify dp_debug_init() and dp_debug_get()
dp_debug_init() always returns 0. So, make it a void function and simplify the only caller accordingly. While at it remove a useless 'rc' initialization in dp_debug_get() Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/dc2d6f535379dd38a5e3f9ba502f1f2b3d1f56b7.1640201523.git.christophe.jaillet@wanadoo.fr Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Diffstat (limited to 'drivers/gpu/drm/msm/dp/dp_debug.c')
-rw-r--r--drivers/gpu/drm/msm/dp/dp_debug.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/gpu/drm/msm/dp/dp_debug.c b/drivers/gpu/drm/msm/dp/dp_debug.c
index 67da4c69eca1..2f9c943f12d5 100644
--- a/drivers/gpu/drm/msm/dp/dp_debug.c
+++ b/drivers/gpu/drm/msm/dp/dp_debug.c
@@ -207,9 +207,8 @@ static const struct file_operations test_active_fops = {
.write = dp_test_active_write
};
-static int dp_debug_init(struct dp_debug *dp_debug, struct drm_minor *minor)
+static void dp_debug_init(struct dp_debug *dp_debug, struct drm_minor *minor)
{
- int rc = 0;
char path[64];
struct dp_debug_private *debug = container_of(dp_debug,
struct dp_debug_private, dp_debug);
@@ -232,17 +231,15 @@ static int dp_debug_init(struct dp_debug *dp_debug, struct drm_minor *minor)
debugfs_create_file("msm_dp_test_type", 0444,
debug->root,
debug, &dp_test_type_fops);
-
- return rc;
}
struct dp_debug *dp_debug_get(struct device *dev, struct dp_panel *panel,
struct dp_usbpd *usbpd, struct dp_link *link,
struct drm_connector *connector, struct drm_minor *minor)
{
- int rc = 0;
struct dp_debug_private *debug;
struct dp_debug *dp_debug;
+ int rc;
if (!dev || !panel || !usbpd || !link) {
DRM_ERROR("invalid input\n");
@@ -269,11 +266,7 @@ struct dp_debug *dp_debug_get(struct device *dev, struct dp_panel *panel,
dp_debug->hdisplay = 0;
dp_debug->vrefresh = 0;
- rc = dp_debug_init(dp_debug, minor);
- if (rc) {
- devm_kfree(dev, debug);
- goto error;
- }
+ dp_debug_init(dp_debug, minor);
return dp_debug;
error: