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: 13684 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 6808423EC8 for ; Mon, 24 Dec 2012 08:42:07 +0000 (UTC) Received: from mail-vb0-f42.google.com (mail-vb0-f42.google.com [209.85.212.42]) by fiordland.canonical.com (Postfix) with ESMTP id 1D27CA18DC6 for ; Mon, 24 Dec 2012 08:42:07 +0000 (UTC) Received: by mail-vb0-f42.google.com with SMTP id fa15so7367947vbb.29 for ; Mon, 24 Dec 2012 00:42:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=BiVuahGdTk7wkXu5siHpGp3K7bCAhuZhYIQevxp0uiU=; b=loFtKTIE9OGoyqvTpLl3CJxMP1EmrljPDI++mdOMkJonYEdvDLe5LxGVfy8iSEMUbe tTR1coa4sYo9YG674mKx30ixLVN6rc2PNaC7Y+qix2ZHxDnm9Tf/s/N2jN+mDrJzVbvt 1f2sMDcAWMVWX6fGXb63UqrQy2yQAkhkmhWTVag7iY+Lne3PYJznK9K18DXhtYI2sZ5a M2GcKjCt4+Al7jbFLUZ/Y6EuoNWH2hTSc03pIHqEnMxMcaLyGrVmy+B7lxTDNxCHvfqp mRddqHsQNjKsbC4F9hBuCZzDfGU97fTdB2kB23MBZKjIRyILUJaHZpx4C2bvlokH+Vb+ 4WCw== X-Received: by 10.221.0.79 with SMTP id nl15mr31941473vcb.41.1356338526583; Mon, 24 Dec 2012 00:42:06 -0800 (PST) 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.58.49.133 with SMTP id u5csp184113ven; Mon, 24 Dec 2012 00:42:06 -0800 (PST) X-Received: by 10.66.85.70 with SMTP id f6mr52573608paz.76.1356338525625; Mon, 24 Dec 2012 00:42:05 -0800 (PST) Received: from mail-da0-f47.google.com (mail-da0-f47.google.com [209.85.210.47]) by mx.google.com with ESMTPS id yf4si19775024pbc.81.2012.12.24.00.42.05 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 24 Dec 2012 00:42:05 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.47 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.210.47; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.47 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-da0-f47.google.com with SMTP id s35so3060970dak.34 for ; Mon, 24 Dec 2012 00:42:05 -0800 (PST) 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 Cc: inki.dae@samsung.com, sachin.kamat@linaro.org, patches@linaro.org, airlied@linux.ie, Eunchul Kim 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: ALoCoQmh+ued9AU/wCtTl4/7fgXha7ThfL8Lrnf8pB7jGdBfE7QxoRjbJd/dqD29f7iErpkREmSo 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; }