From patchwork Mon Aug 6 06:46:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 10499 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 79C0423F3F for ; Mon, 6 Aug 2012 06:48:00 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 49C9BA18CE6 for ; Mon, 6 Aug 2012 06:48:00 +0000 (UTC) Received: by yenq6 with SMTP id q6so2178669yen.11 for ; Sun, 05 Aug 2012 23:47:59 -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=e8AeXGJr6LubEqD6uUtOmsih5w07hqTpIS3B4rUQcyo=; b=ng7TaGc1HjtvmO2WqwRY8oBhg+kadKy8lW4QPBa8RE7BkRn2eofY9MWJz4pOqxM5Ub gtTQ1Wh7cGluNaIiXEALX54nerkKAh9XFbxOgiiIHVpaDDKlGpusngtD3E9n/moRMBye mveYQJaEncpQAL3zeO1JdrK/JegA7mSG9pnPVnwBEorS+tahcCrFS6DJV5RlHq7MtpGo trOYMyWiWZMdXmr2HcE/2LgW04fzPmQtjkj3PeDZRPSaDhUqfSxF9Mk8BqM6z35y3rp7 UpLsGszgvAvuQnchXWwqInsY9DuTpZrTyqTjqhSnkwiy3V+tOpxqhswmTq8OWtYHRLIq PN9A== Received: by 10.43.46.194 with SMTP id up2mr8345971icb.22.1344235679271; Sun, 05 Aug 2012 23:47:59 -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 u8csp424405igz; Sun, 5 Aug 2012 23:47:58 -0700 (PDT) Received: by 10.68.224.70 with SMTP id ra6mr16408156pbc.11.1344235678769; Sun, 05 Aug 2012 23:47:58 -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.47.58 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 05 Aug 2012 23:47:58 -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:47:58 -0700 (PDT) Received: by 10.68.203.98 with SMTP id kp2mr16506918pbc.132.1344235678542; Sun, 05 Aug 2012 23:47:58 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id ql6sm8331600pbc.61.2012.08.05.23.47.55 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 05 Aug 2012 23:47:57 -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 3/5] drm/exynos: Use devm_kzalloc in exynos_drm_vidi.c file Date: Mon, 6 Aug 2012 12:16:18 +0530 Message-Id: <1344235580-3030-4-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: ALoCoQk1PL60E+GAiwIp/g6oVQNkl7CDcKYGvmbNSSQ7RBMhUW08lgksSloAlKTd+5QrGoej23JB 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_vidi.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c index bb1550c..537027a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c @@ -633,7 +633,7 @@ static int __devinit vidi_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) return -ENOMEM; @@ -673,8 +673,6 @@ static int __devexit vidi_remove(struct platform_device *pdev) ctx->raw_edid = NULL; } - kfree(ctx); - return 0; }