* [PATCH] drm/exynos: remove no need devm_kfree in probe
@ 2020-04-26 2:05 Bernard Zhao
0 siblings, 0 replies; only message in thread
From: Bernard Zhao @ 2020-04-26 2:05 UTC (permalink / raw)
To: Inki Dae, Joonyoung Shim, Seung-Woo Kim, Kyungmin Park,
David Airlie, Daniel Vetter, Kukjin Kim, Krzysztof Kozlowski,
dri-devel, linux-arm-kernel, linux-samsung-soc, linux-kernel
Cc: opensource.kernel, Bernard Zhao
Remove no need devm_kfree in probe.
The change is to make the code a bit more readable
Signed-off-by: Bernard Zhao <bernard@vivo.com>
---
drivers/gpu/drm/exynos/exynos_drm_dpi.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dpi.c b/drivers/gpu/drm/exynos/exynos_drm_dpi.c
index 43fa0f26c052..e06f7d7a6695 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dpi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dpi.c
@@ -181,10 +181,8 @@ static int exynos_dpi_parse_dt(struct exynos_dpi *ctx)
return -ENOMEM;
ret = of_get_videomode(dn, vm, 0);
- if (ret < 0) {
- devm_kfree(dev, vm);
+ if (ret < 0)
return ret;
- }
ctx->vm = vm;
@@ -233,10 +231,8 @@ struct drm_encoder *exynos_dpi_probe(struct device *dev)
ctx->dev = dev;
ret = exynos_dpi_parse_dt(ctx);
- if (ret < 0) {
- devm_kfree(dev, ctx);
- return NULL;
- }
+ if (ret < 0)
+ return ERR_PTR(ret);
if (ctx->panel_node) {
ctx->panel = of_drm_find_panel(ctx->panel_node);
--
2.26.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-04-26 2:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-26 2:05 [PATCH] drm/exynos: remove no need devm_kfree in probe Bernard Zhao
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).