From patchwork Mon Dec 24 08:33:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 1908381 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 1D94E40061 for ; Mon, 24 Dec 2012 09:44:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0D21DE615C for ; Mon, 24 Dec 2012 01:44:51 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-da0-f42.google.com (mail-da0-f42.google.com [209.85.210.42]) by gabe.freedesktop.org (Postfix) with ESMTP id DF935E5DC0 for ; Mon, 24 Dec 2012 00:42:27 -0800 (PST) Received: by mail-da0-f42.google.com with SMTP id z17so3071784dal.15 for ; Mon, 24 Dec 2012 00:42:27 -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=FMbxjdI6NbABvYpuwmVPX7LFMS78i/sGAXTFIJcZCpI=; b=VOw/dttHqmaDReLqtKzmJ9Asw0ga94Wp3p6EhdNFBz/yl2mSlAHhR0S9jgorjntHpf wswJj5GogyxHMog5OTaGIKgerUcUyptA/yXE0j1jCQjD97qigRTriF/F5pye6TJy2oON CyBUa1ekxBA3yHU2VAPiMhC+v22qko+2oNgGC65TYZyWzGufSzfy3QiOEf48af9w/8yR k1DQwgh83iaj/9LX1vB4eVHQH8cWVPImnzhe2RFsZdbL2Pby/XO/v+L61F3zpyeJorhp ZCI6RW+pMMND2PiUYcS4/7U/bz1GuNVdvwrMdVp33fghTwkf9tGknTpqLZ2rfWTxBMQJ vM9g== X-Received: by 10.66.77.38 with SMTP id p6mr61175283paw.47.1356338547763; Mon, 24 Dec 2012 00:42:27 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id pv8sm11959096pbc.26.2012.12.24.00.42.24 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 24 Dec 2012 00:42:27 -0800 (PST) From: Sachin Kamat To: dri-devel@lists.freedesktop.org Subject: [PATCH 08/10] drm/exynos: Remove explicit freeing using devm_* APIs in exynos_drm_gsc.c Date: Mon, 24 Dec 2012 14:03:49 +0530 Message-Id: <1356338031-23674-9-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: ALoCoQkRZiktM4UCFJGXScoiy6zgzFvjCI9RaCRiST9D2mbPPWLpdjufSkgFuknh3Nf40zXf65Ta X-Mailman-Approved-At: Mon, 24 Dec 2012 01:36:58 -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_* APIs are device managed and get freed automatically when the device detaches. Thus explicit freeing is not needed. This saves some code. Cc: Eunchul Kim Signed-off-by: Sachin Kamat --- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 15 +++------------ 1 files changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 5639353..3b47a7d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -1699,8 +1699,7 @@ static int __devinit gsc_probe(struct platform_device *pdev) ctx->gsc_clk = clk_get(dev, "gscl"); if (IS_ERR(ctx->gsc_clk)) { dev_err(dev, "failed to get gsc clock.\n"); - ret = PTR_ERR(ctx->gsc_clk); - goto err_ctx; + return PTR_ERR(ctx->gsc_clk); } /* resource memory */ @@ -1723,7 +1722,7 @@ static int __devinit gsc_probe(struct platform_device *pdev) if (!res) { dev_err(dev, "failed to request irq resource.\n"); ret = -ENOENT; - goto err_get_regs; + goto err_clk; } ctx->irq = res->start; @@ -1731,7 +1730,7 @@ static int __devinit gsc_probe(struct platform_device *pdev) IRQF_ONESHOT, "drm_gsc", ctx); if (ret < 0) { dev_err(dev, "failed to request irq.\n"); - goto err_get_regs; + goto err_clk; } /* context initailization */ @@ -1775,12 +1774,8 @@ err_ippdrv_register: pm_runtime_disable(dev); err_get_irq: free_irq(ctx->irq, ctx); -err_get_regs: - devm_iounmap(dev, ctx->regs); err_clk: clk_put(ctx->gsc_clk); -err_ctx: - devm_kfree(dev, ctx); return ret; } @@ -1798,12 +1793,8 @@ static int __devexit gsc_remove(struct platform_device *pdev) pm_runtime_disable(dev); free_irq(ctx->irq, ctx); - devm_iounmap(dev, ctx->regs); - clk_put(ctx->gsc_clk); - devm_kfree(dev, ctx); - return 0; }