* [PATCH] drm/msm/dp: Simplify dp_debug_init() and dp_debug_get()
@ 2021-12-22 19:33 Christophe JAILLET
2022-01-05 23:06 ` Stephen Boyd
0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2021-12-22 19:33 UTC (permalink / raw)
To: robdclark, sean, quic_abhinavk, airlied, daniel, swboyd, bjorn.andersson
Cc: linux-arm-msm, kernel-janitors, linux-kernel, dri-devel,
Christophe JAILLET, freedreno
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>
---
drivers/gpu/drm/msm/dp/dp_debug.c | 13 +++----------
1 file 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 da4323556ef3..338f1f9c4d14 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;
struct dp_debug_private *debug = container_of(dp_debug,
struct dp_debug_private, dp_debug);
@@ -229,17 +228,15 @@ static int dp_debug_init(struct dp_debug *dp_debug, struct drm_minor *minor)
debug, &dp_test_type_fops);
debug->root = minor->debugfs_root;
-
- 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");
@@ -266,11 +263,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:
--
2.32.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/msm/dp: Simplify dp_debug_init() and dp_debug_get()
2021-12-22 19:33 [PATCH] drm/msm/dp: Simplify dp_debug_init() and dp_debug_get() Christophe JAILLET
@ 2022-01-05 23:06 ` Stephen Boyd
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2022-01-05 23:06 UTC (permalink / raw)
To: Christophe JAILLET, airlied, bjorn.andersson, daniel,
quic_abhinavk, robdclark, sean
Cc: linux-arm-msm, kernel-janitors, freedreno, linux-kernel, dri-devel
Quoting Christophe JAILLET (2021-12-22 11:33:47)
> 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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-05 23:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-22 19:33 [PATCH] drm/msm/dp: Simplify dp_debug_init() and dp_debug_get() Christophe JAILLET
2022-01-05 23:06 ` Stephen Boyd
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).