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: 10500 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 954B523F3F for ; Mon, 6 Aug 2012 06:48:03 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 601F7A18CE6 for ; Mon, 6 Aug 2012 06:48:03 +0000 (UTC) Received: by yhpp61 with SMTP id p61so299994yhp.11 for ; Sun, 05 Aug 2012 23:48:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=jR6FI6FQMJycRFgUpPnOIIXlBxFMBm019SgMQd1d0jI=; b=L8iLTIPvoOya56zwIPF4OK4p3aDYUqi7abx7IqMe2EL4CM4wyewMmdbUqii1JnbQMy sFevKDpDl+A4cbz0T/eAQol0jc9amcenAA+sVfCpKmxWOxfVo0n6LPZX74HLv/dOAnbx orSIQZlOH70UiIrsLLam68BgeU6Md4qRvFKsbDayiMmZGVJsenSkdQPehbAKJSzcifPd FKW5RhgJ7Qvu2StObU2BdNo+2otw/W+IJ28GoHdemVbd4PIgD+f5Y2Nq7TI3Cp7lT3nO aJb7vHaMqgLSkVEsC4CofpiLYQ39z3I1SsvQKCbagfdF8WS1hf2zTB2Btg74g9TzoALW 9+DQ== Received: by 10.50.149.134 with SMTP id ua6mr4481140igb.11.1344235682589; Sun, 05 Aug 2012 23:48:02 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.87.40 with SMTP id u8csp424408igz; Sun, 5 Aug 2012 23:48:02 -0700 (PDT) Received: by 10.66.80.165 with SMTP id s5mr15966396pax.41.1344235682011; Sun, 05 Aug 2012 23:48:02 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id go9si19025681pbc.157.2012.08.05.23.48.01 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 05 Aug 2012 23:48:02 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-pb0-f50.google.com with SMTP id md12so3840460pbc.37 for ; Sun, 05 Aug 2012 23:48:01 -0700 (PDT) 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 Cc: inki.dae@samsung.com, airlied@linux.ie, sachin.kamat@linaro.org, patches@linaro.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: ALoCoQnlxNS0NBXZU+O9V9Ns/5umLGIWGePvRgTp+9nArhmSu+4XNZsmipVqR8q3ZSioZXGuPH+r 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; }