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: 1277071 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id ECB5F3FD57 for ; Mon, 6 Aug 2012 07:30:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E223B9EEE1 for ; Mon, 6 Aug 2012 00:30:42 -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 D69679EC53 for ; Sun, 5 Aug 2012 23:48:16 -0700 (PDT) Received: by pbbrq13 with SMTP id rq13so5439889pbb.36 for ; Sun, 05 Aug 2012 23:47:58 -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=e8AeXGJr6LubEqD6uUtOmsih5w07hqTpIS3B4rUQcyo=; b=l2VlcNXvA+j/L3W8bXCtmbiPTDWmmjitWyeML35bhOIAMiVDWvJZt5H7mWR2nzl3X0 kDm+IbOnb5Qe5dRmviwGxk8uM6hZobSESYnqeBlXlFLh55YHjJOJFdmnvhE1UhVE8Qtc jYKSzAkXgqdKoHbcFH6naE3ClWCYF1CUR2+KPHmwdjqnj2Qrrh8kbvNlYtj55Tj0kb1l j8QMEYjyRqS/empJK8L/6FLjdupjI2VVFRuoY+emq8iEvALXQpw/iwd81+Jdlaw0WQNW GSPkdLhjMhvAXFB0RACFJkD8GfOGD/SjNshoF7XZt38eOILzznT8toKlwvJPFtBW6kYt 6nXQ== 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 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: ALoCoQkh0dD41txHw2C0jdJKEgsl1UcWqhnru3DO2YKE7AMd3XhyAOQvrPkDXjs9PmeyBZHiNvap 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_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; }