Skip to content

Commit ae18294

Browse files
Sachin Kamatdaeinki
authored andcommitted
drm/exynos: Use devm_kzalloc in exynos_drm_hdmi.c file
devm_kzalloc is a device managed function and makes freeing and error handling simpler. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
1 parent 59848db commit ae18294

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/gpu/drm/exynos/exynos_drm_hdmi.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ static int __devinit exynos_drm_hdmi_probe(struct platform_device *pdev)
345345

346346
DRM_DEBUG_KMS("%s\n", __FILE__);
347347

348-
ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
348+
ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
349349
if (!ctx) {
350350
DRM_LOG_KMS("failed to alloc common hdmi context.\n");
351351
return -ENOMEM;
@@ -371,7 +371,6 @@ static int __devexit exynos_drm_hdmi_remove(struct platform_device *pdev)
371371
DRM_DEBUG_KMS("%s\n", __FILE__);
372372

373373
exynos_drm_subdrv_unregister(&ctx->subdrv);
374-
kfree(ctx);
375374

376375
return 0;
377376
}

0 commit comments

Comments
 (0)