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: 13691 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 BBA4D23EC8 for ; Mon, 24 Dec 2012 08:42:29 +0000 (UTC) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by fiordland.canonical.com (Postfix) with ESMTP id 76AFFA18DC6 for ; Mon, 24 Dec 2012 08:42:29 +0000 (UTC) Received: by mail-vc0-f172.google.com with SMTP id fw7so7228889vcb.31 for ; Mon, 24 Dec 2012 00:42:29 -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=FMbxjdI6NbABvYpuwmVPX7LFMS78i/sGAXTFIJcZCpI=; b=K0UgPNn59d64f3Ey/dopEERD4k/1BzukvKFF4LCtXLm0KGSNhV+H0Guuk0R2xKxRSl QIP604FGDpRmgfDrC+1Vp577LlhvsG8AvQfJPs+fEsB68Ic1w62t1fyr6fspVBjfGC9+ BO77EITfGlfqoqEHhQnKk5kelewE9vLGOveZcnEtUOTkb2OZYbFx9JwP7LTRTAgaHX1h q7RqlkrCK7UtK9/DSHHXPLeM2stBhnCkh2gcixcbSranSJe9ChNXT5HJ3JjiptPLdRNZ yHsek0M4R9PDNE1a5LV9QdxqzSUQvgF68cYP/FEiSHtj/Quh/qNvayv/fkQxo6iZVxMz q4zw== X-Received: by 10.52.176.6 with SMTP id ce6mr27829562vdc.57.1356338549002; Mon, 24 Dec 2012 00:42:29 -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 u5csp184124ven; Mon, 24 Dec 2012 00:42:28 -0800 (PST) X-Received: by 10.68.232.42 with SMTP id tl10mr65695797pbc.108.1356338548138; Mon, 24 Dec 2012 00:42:28 -0800 (PST) Received: from mail-pb0-f43.google.com (mail-pb0-f43.google.com [209.85.160.43]) by mx.google.com with ESMTPS id p7si20184574pav.166.2012.12.24.00.42.27 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 24 Dec 2012 00:42:28 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.43 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.43; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.43 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-f43.google.com with SMTP id um15so3883056pbc.30 for ; Mon, 24 Dec 2012 00:42:27 -0800 (PST) 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 Cc: inki.dae@samsung.com, sachin.kamat@linaro.org, patches@linaro.org, airlied@linux.ie, Eunchul Kim 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: ALoCoQncHrqCJPnQNj46yoiMHz93YMR/ANuqoqnt3DEx1nd72dB20IOihof2dOXhOSKIaiOfAKA9 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; }