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: 13693 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 7ADBE23EC8 for ; Mon, 24 Dec 2012 08:42:36 +0000 (UTC) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by fiordland.canonical.com (Postfix) with ESMTP id 260F3A18DDD for ; Mon, 24 Dec 2012 08:42:36 +0000 (UTC) Received: by mail-vc0-f171.google.com with SMTP id n11so7347697vch.30 for ; Mon, 24 Dec 2012 00:42:35 -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=zbSrXLW0zUzoLvHJpYKu3c0Zvh10mL6E1VDzZW4O2Fk=; b=A/PAVlu6DKn8jFhD3PCfqk53WsJfLFUwtsG/JxpetB2TelnOHkNwOk2QarqOBTdxry 85jZQVReRnEnz/LWz6T1Zz7uZTNO8T/2jP/dTiX3NFTFcsO+mkiLInlhN15UFdxkARvD Xl6YUqikuu44/mVad7oF8KKuzoUTKssSSW5w8Xbutz7KJTWGrgb4EsOesHZvbx8nJ2eb s1XXfMiQOHvLBUkmaEWXVvrL2aCkMVB5UUi0DP4EDTeU1krRMFsdA+JuVZx3GU6gYilY QgqBtiNmCgEafOqdGrygYP9NhFySZFYCaq5oeYs3lj034dYP1kQQvQHUPvY+wolEnxd+ 8n4g== X-Received: by 10.220.238.139 with SMTP id ks11mr31166574vcb.49.1356338555620; Mon, 24 Dec 2012 00:42:35 -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 u5csp184126ven; Mon, 24 Dec 2012 00:42:35 -0800 (PST) X-Received: by 10.68.132.34 with SMTP id or2mr65401981pbb.133.1356338554653; Mon, 24 Dec 2012 00:42:34 -0800 (PST) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by mx.google.com with ESMTPS id px7si19769894pbb.110.2012.12.24.00.42.34 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 24 Dec 2012 00:42:34 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.52 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.52; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.52 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-pa0-f52.google.com with SMTP id fb1so3956666pad.11 for ; Mon, 24 Dec 2012 00:42:34 -0800 (PST) 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 Cc: inki.dae@samsung.com, sachin.kamat@linaro.org, patches@linaro.org, airlied@linux.ie, Eunchul Kim 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: ALoCoQnmr/UIQNU4ha7km0WiYi/NXhA65I/BOp/P+I1OfXcggpaGGxta63OMyDQxoyEeYDXu+TQB 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; }