From patchwork Mon Aug 6 06:46:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 1277161 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 17A60DFF71 for ; Mon, 6 Aug 2012 07:42:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 07A4A9E8B0 for ; Mon, 6 Aug 2012 00:42:46 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pb0-f49.google.com (mail-pb0-f49.google.com [209.85.160.49]) by gabe.freedesktop.org (Postfix) with ESMTP id DEBC99ECA9 for ; Sun, 5 Aug 2012 23:48:16 -0700 (PDT) Received: by pbbrq13 with SMTP id rq13so5439965pbb.36 for ; Sun, 05 Aug 2012 23:48:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=jR6FI6FQMJycRFgUpPnOIIXlBxFMBm019SgMQd1d0jI=; b=ianfiHFOE2eACxVEDVNdkBm6GXN6+MfB8jQHaYg5dHta/QC66GT9ANHZ+zlVfX/6Zx r25TDbpLoTSmRGxaVP4q96Ugse8V3OrzlvgaDDI7E9jN0dVLYsaQP8fmnJrTnEUY0f1q 6r4gpWMAu5qenm/M6Pu+4Kw0I6jFLBZwGJcrEzkJiLvwSQlwVi+dYwHTYnCVpC7VDOcd Lm02GAYx3MRewQibbsHw3R86X0EvSHC3WFHVncMfnLB4rGqLaFAi7wzop96SkT+pxxuu 2EZoKLTrkgk84MsWc3zCQ7Gv8y1RX2S19g9u1z1CtLv5As1DuwXAcuD6IQJKKyVPy6ET /GKw== Received: by 10.68.130.67 with SMTP id oc3mr16512593pbb.18.1344235681782; Sun, 05 Aug 2012 23:48:01 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id ql6sm8331600pbc.61.2012.08.05.23.47.58 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 05 Aug 2012 23:48:01 -0700 (PDT) From: Sachin Kamat To: dri-devel@lists.freedesktop.org Subject: [PATCH 4/5] drm/exynos: Use devm_kzalloc in exynos_drm_hdmi.c file Date: Mon, 6 Aug 2012 12:16:19 +0530 Message-Id: <1344235580-3030-5-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1344235580-3030-1-git-send-email-sachin.kamat@linaro.org> References: <1344235580-3030-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQmru8mtUGwkeRmCqDoI0hYk20xaZFiUxVnaRLl8ii1gWKHqNJEi6hTvfr5nZShmn2vBKcnn X-Mailman-Approved-At: Mon, 06 Aug 2012 00:18:44 -0700 Cc: patches@linaro.org, sachin.kamat@linaro.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org devm_kzalloc is a device managed function and makes freeing and error handling simpler. Signed-off-by: Sachin Kamat --- drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c index 8ffcdf8..3fdf0b6 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c @@ -345,7 +345,7 @@ static int __devinit exynos_drm_hdmi_probe(struct platform_device *pdev) DRM_DEBUG_KMS("%s\n", __FILE__); - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); if (!ctx) { DRM_LOG_KMS("failed to alloc common hdmi context.\n"); return -ENOMEM; @@ -371,7 +371,6 @@ static int __devexit exynos_drm_hdmi_remove(struct platform_device *pdev) DRM_DEBUG_KMS("%s\n", __FILE__); exynos_drm_subdrv_unregister(&ctx->subdrv); - kfree(ctx); return 0; }