From patchwork Fri Nov 23 03:41:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 1793911 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 C06F5DF230 for ; Fri, 23 Nov 2012 06:41:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CD9E6E6370 for ; Thu, 22 Nov 2012 22:41:57 -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 DDE74E5EDA for ; Thu, 22 Nov 2012 19:48:21 -0800 (PST) Received: by mail-da0-f49.google.com with SMTP id v40so2630563dad.36 for ; Thu, 22 Nov 2012 19:48:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=u15qcggUIZD6P8Ob8nsyj0uMxIbbppSuq1rPayGlVA8=; b=JU4Lj6t3fIVNKqe7B+Rps0PsV42pGhWt/bEB7miS0Z27+fZI9Kh5mozvrTY1nVe46a mTSv/QT732VrrTeabt6/h4pOkyX0KIsZCTYgKtu2AcDoodbxM1WgFyyZPi1DptY5Ez/G qfRJVpyE1X+YZhyILyBbnkKjQFuocgickDELpwSQ9sYFqHZcLWeg2IW/KUfsxZte6w71 grqAomQWsfMJ2fTuIg2tzUV5upALei2gwdNgxPTPVBAcC5GPWjQ7HGFJfqgbW83jh2Aa W05LpRl5LgSPUVKsQZymf5rfS2h4r1CqjnukkYIR9Kppw4GVbXaIxDApBUL3hjTGl5eS loDA== Received: by 10.66.78.4 with SMTP id x4mr6793352paw.60.1353642501819; Thu, 22 Nov 2012 19:48:21 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id x8sm2937337paw.16.2012.11.22.19.48.18 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Nov 2012 19:48:21 -0800 (PST) From: Sachin Kamat To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/5] drm/exynos: Use devm_clk_get in exynos_drm_fimd.c Date: Fri, 23 Nov 2012 09:11:55 +0530 Message-Id: <1353642119-10253-2-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1353642119-10253-1-git-send-email-sachin.kamat@linaro.org> References: <1353642119-10253-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQkKhyE+vaAsApmR98TG515Me29h9cB92PgF5IElraP+7A/7t1GSIODz/IIVBy4yUEENgqUU X-Mailman-Approved-At: Thu, 22 Nov 2012 22:38:55 -0800 Cc: patches@linaro.org, sachin.kamat@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_clk_get is device managed and makes error handling and exit code simpler. Signed-off-by: Sachin Kamat --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index ad04edd..57851cc 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -846,14 +846,14 @@ static int __devinit fimd_probe(struct platform_device *pdev) if (!ctx) return -ENOMEM; - ctx->bus_clk = clk_get(dev, "fimd"); + ctx->bus_clk = devm_clk_get(dev, "fimd"); if (IS_ERR(ctx->bus_clk)) { dev_err(dev, "failed to get bus clock\n"); ret = PTR_ERR(ctx->bus_clk); goto err_clk_get; } - ctx->lcd_clk = clk_get(dev, "sclk_fimd"); + ctx->lcd_clk = devm_clk_get(dev, "sclk_fimd"); if (IS_ERR(ctx->lcd_clk)) { dev_err(dev, "failed to get lcd clock\n"); ret = PTR_ERR(ctx->lcd_clk); @@ -918,11 +918,9 @@ static int __devinit fimd_probe(struct platform_device *pdev) err_clk: clk_disable(ctx->lcd_clk); - clk_put(ctx->lcd_clk); err_bus_clk: clk_disable(ctx->bus_clk); - clk_put(ctx->bus_clk); err_clk_get: return ret; @@ -949,9 +947,6 @@ static int __devexit fimd_remove(struct platform_device *pdev) out: pm_runtime_disable(dev); - clk_put(ctx->lcd_clk); - clk_put(ctx->bus_clk); - return 0; }