From patchwork Mon Dec 24 08:33:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 1908401 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 BF64CDFB7B for ; Mon, 24 Dec 2012 09:46:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AA048E6168 for ; Mon, 24 Dec 2012 01:46:30 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-da0-f49.google.com (mail-da0-f49.google.com [209.85.210.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 8CDC6E5E9C for ; Mon, 24 Dec 2012 00:42:34 -0800 (PST) Received: by mail-da0-f49.google.com with SMTP id v40so3051045dad.22 for ; Mon, 24 Dec 2012 00:42:34 -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=zbSrXLW0zUzoLvHJpYKu3c0Zvh10mL6E1VDzZW4O2Fk=; b=W8LLw8EurDT7cgZvokhzX5upEqIC4OVOR/VAV7684+tqtY9H1fLzXuAy+FoXu+YbRJ 7osME7Znh2wjvw2rvkJaDGHLkpblEy1n9Xp2l5U4LBlEo9KiHZqIacB411vjBCg2j/DC YIRFMynciHKG+phND+J7QMeZMW18ofpQ63U6+3DllNP3OtbQWxRArr85wJoEUvdoAzx3 Qi1AiLsNK41L/I2nGfdL+X4kGFho0LFPrkeDhRLJe/O1klskkSWTMdoZbCPHpZvuSnOc G3SuvvKJa08fKXeF+yesYau295m2RKiRn9zVlCvQVrtW1Sy5bBvNmfL0CATKTXnj9ueQ OOMg== X-Received: by 10.68.131.8 with SMTP id oi8mr64947966pbb.29.1356338554301; Mon, 24 Dec 2012 00:42:34 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id pv8sm11959096pbc.26.2012.12.24.00.42.31 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 24 Dec 2012 00:42:33 -0800 (PST) From: Sachin Kamat To: dri-devel@lists.freedesktop.org Subject: [PATCH 10/10] drm/exynos: Use devm_clk_get in exynos_drm_gsc.c Date: Mon, 24 Dec 2012 14:03:51 +0530 Message-Id: <1356338031-23674-11-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: ALoCoQmem9ov5fL1tTsKdWdQ2fyzS3zllb4lZtaSA3K7jvnqVki13JYDjJhjj+CM5iOVgRLSaezZ 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 This eliminates the need for explicit clk_put and makes the cleanup and exit path code simpler. Cc: Eunchul Kim Signed-off-by: Sachin Kamat --- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 13 ++++--------- 1 files changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index e21a0d9..0497e90 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -1696,7 +1696,7 @@ static int __devinit gsc_probe(struct platform_device *pdev) return -ENOMEM; /* clock control */ - ctx->gsc_clk = clk_get(dev, "gscl"); + ctx->gsc_clk = devm_clk_get(dev, "gscl"); if (IS_ERR(ctx->gsc_clk)) { dev_err(dev, "failed to get gsc clock.\n"); return PTR_ERR(ctx->gsc_clk); @@ -1707,16 +1707,14 @@ static int __devinit gsc_probe(struct platform_device *pdev) ctx->regs = devm_request_and_ioremap(dev, ctx->regs_res); if (!ctx->regs) { dev_err(dev, "failed to map registers.\n"); - ret = -ENXIO; - goto err_clk; + return -ENXIO; } /* resource irq */ res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!res) { dev_err(dev, "failed to request irq resource.\n"); - ret = -ENOENT; - goto err_clk; + return -ENOENT; } ctx->irq = res->start; @@ -1724,7 +1722,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_clk; + return ret; } /* context initailization */ @@ -1768,8 +1766,6 @@ err_ippdrv_register: pm_runtime_disable(dev); err_get_irq: free_irq(ctx->irq, ctx); -err_clk: - clk_put(ctx->gsc_clk); return ret; } @@ -1787,7 +1783,6 @@ static int __devexit gsc_remove(struct platform_device *pdev) pm_runtime_disable(dev); free_irq(ctx->irq, ctx); - clk_put(ctx->gsc_clk); return 0; }