From patchwork Mon Dec 24 08:33:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 1908311 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 0B516E00D8 for ; Mon, 24 Dec 2012 09:39:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EAD8BE5F99 for ; Mon, 24 Dec 2012 01:39:15 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-da0-f54.google.com (mail-da0-f54.google.com [209.85.210.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 3799EE5C30 for ; Mon, 24 Dec 2012 00:42:05 -0800 (PST) Received: by mail-da0-f54.google.com with SMTP id n2so3068634dad.27 for ; Mon, 24 Dec 2012 00:42:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=BiVuahGdTk7wkXu5siHpGp3K7bCAhuZhYIQevxp0uiU=; b=G5/IhnxNfW2uwWlFohkgbxCeoWq7dYeo+ajOuaZ0Vm0Frr+THzTidmQGzSRuImQRfA s1khXUREjMRLZCRUnZadKD0nKBw3XZTODqG+GDTDQiAy9D0U8xiMFx4H6ZX/InWzoTcw gSlZxSRLnz7JbpQeq0LL0SE15XJpToJqIkXArawHtgjBwk04um8rNtXxElhC5bc/6IvR 4+De3IQ7o87O1vp+UWQu7iJeqZhVa7G/zIMaIhmEwp4irQdmK2BrIWsrU5nDLFvKe1+X rBpdS824V3BfJ2V7HFd0cGX12B6Z6jgAOskOYpqqwrCrROvPwEap3m5OciiJVNVxhR3J ICgg== X-Received: by 10.68.138.195 with SMTP id qs3mr64826684pbb.62.1356338525073; Mon, 24 Dec 2012 00:42:05 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id pv8sm11959096pbc.26.2012.12.24.00.42.01 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 24 Dec 2012 00:42:04 -0800 (PST) From: Sachin Kamat To: dri-devel@lists.freedesktop.org Subject: [PATCH 01/10] drm/exynos: Use devm_kzalloc in exynos_drm_ipp.c Date: Mon, 24 Dec 2012 14:03:42 +0530 Message-Id: <1356338031-23674-2-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1356338031-23674-1-git-send-email-sachin.kamat@linaro.org> References: <1356338031-23674-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQmYroc8CZH4fITNdDWEpBBbhn8Rr8N1eOlOKZfHdu/HqDjaOmTVJHDytaxNnGTwLg3vvH2q X-Mailman-Approved-At: Mon, 24 Dec 2012 01:36:57 -0800 Cc: sachin.kamat@linaro.org, patches@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 makes the code simpler by eliminating the need for explicit freeing. Cc: Eunchul Kim Signed-off-by: Sachin Kamat --- drivers/gpu/drm/exynos/exynos_drm_ipp.c | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index 49eebe9..441b719 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -1895,7 +1895,7 @@ static int __devinit ipp_probe(struct platform_device *pdev) struct exynos_drm_subdrv *subdrv; int ret; - ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); + ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); if (!ctx) return -ENOMEM; @@ -1916,8 +1916,7 @@ static int __devinit ipp_probe(struct platform_device *pdev) ctx->event_workq = create_singlethread_workqueue("ipp_event"); if (!ctx->event_workq) { dev_err(dev, "failed to create event workqueue\n"); - ret = -EINVAL; - goto err_clear; + return -EINVAL; } /* @@ -1958,8 +1957,6 @@ err_cmd_workq: destroy_workqueue(ctx->cmd_workq); err_event_workq: destroy_workqueue(ctx->event_workq); -err_clear: - kfree(ctx); return ret; } @@ -1985,8 +1982,6 @@ static int __devexit ipp_remove(struct platform_device *pdev) destroy_workqueue(ctx->cmd_workq); destroy_workqueue(ctx->event_workq); - kfree(ctx); - return 0; }