From patchwork Fri Nov 23 11:04:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13140 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 9952D23FC6 for ; Fri, 23 Nov 2012 11:11:12 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 3F948A194A6 for ; Fri, 23 Nov 2012 11:11:12 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so1660847ieb.11 for ; Fri, 23 Nov 2012 03:11:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=L/MN43TQWr9Fg2FJAHeIb0uGLYtIEsusXIkLNGT2SJc=; b=QRzF+R4vduXM555ZWd0zGbiy+Idieii7vUDx7DdPBcExKAywIPIb/jc/qQKLXN3BK9 cfnikCgIEbSi0u2FO0dyomToFVfdjApdef113mTP7KkVreA8ydz2xX4sS6TZkhe5jJMV MbFy1zyhdKkCV1joLzX2T7u0Rhgb7ws63bLtWlVLef3pS1OF2f7DpQH/MPD82415DXhS 9yj1+noBibuKPEqaKIKHv7444r6UN5fuJMxzlBr4BTxUXXBvx8RSCCfBCaPiKMTs3L0p rk8tibZI6X/WD6bZAYI9kHCt0Zsf/CCLZj/jM28GpUvba5Ob6FI+/UwqW0xWHOpvOsKa 9XDA== Received: by 10.50.91.195 with SMTP id cg3mr5783697igb.57.1353669072010; Fri, 23 Nov 2012 03:11:12 -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.50.67.148 with SMTP id n20csp336312igt; Fri, 23 Nov 2012 03:11:11 -0800 (PST) Received: by 10.68.137.41 with SMTP id qf9mr13221670pbb.103.1353669071461; Fri, 23 Nov 2012 03:11:11 -0800 (PST) Received: from mail-da0-f41.google.com (mail-da0-f41.google.com [209.85.210.41]) by mx.google.com with ESMTPS id p7si7654081pay.322.2012.11.23.03.11.11 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 23 Nov 2012 03:11:11 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.41 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.210.41; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.41 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-da0-f41.google.com with SMTP id e20so2557311dak.0 for ; Fri, 23 Nov 2012 03:11:11 -0800 (PST) Received: by 10.66.86.101 with SMTP id o5mr9661491paz.15.1353669071210; Fri, 23 Nov 2012 03:11:11 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id wf8sm3667394pbc.65.2012.11.23.03.11.08 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 23 Nov 2012 03:11:10 -0800 (PST) From: Sachin Kamat To: linux-media@vger.kernel.org Cc: s.nawrocki@samsung.com, sachin.kamat@linaro.org, patches@linaro.org, Shaik Ameer Basha Subject: [PATCH v2 3/4] [media] exynos-gsc: Use devm_clk_get() Date: Fri, 23 Nov 2012 16:34:41 +0530 Message-Id: <1353668682-13366-4-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1353668682-13366-1-git-send-email-sachin.kamat@linaro.org> References: <1353668682-13366-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQnjLPHhXPjrGdOoS3wVdbsl1NxKAUBnt9BhDNDpQ9KEMhXTVf72VH6iHkhgWps/PKv4fvQ5 devm_clk_get() is a device managed function and makes error handling a bit simpler. Cc: Shaik Ameer Basha Signed-off-by: Sachin Kamat --- drivers/media/platform/exynos-gsc/gsc-core.c | 13 +++---------- 1 files changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c index 99ee1a9..5a285b2 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/exynos-gsc/gsc-core.c @@ -1006,8 +1006,6 @@ static void gsc_clk_put(struct gsc_dev *gsc) return; clk_unprepare(gsc->clock); - clk_put(gsc->clock); - gsc->clock = NULL; } static int gsc_clk_get(struct gsc_dev *gsc) @@ -1016,26 +1014,21 @@ static int gsc_clk_get(struct gsc_dev *gsc) dev_dbg(&gsc->pdev->dev, "gsc_clk_get Called\n"); - gsc->clock = clk_get(&gsc->pdev->dev, GSC_CLOCK_GATE_NAME); + gsc->clock = devm_clk_get(&gsc->pdev->dev, GSC_CLOCK_GATE_NAME); if (IS_ERR(gsc->clock)) { dev_err(&gsc->pdev->dev, "failed to get clock~~~: %s\n", GSC_CLOCK_GATE_NAME); - goto err; + return PTR_ERR(gsc->clock); } ret = clk_prepare(gsc->clock); if (ret < 0) { dev_err(&gsc->pdev->dev, "clock prepare failed for clock: %s\n", GSC_CLOCK_GATE_NAME); - clk_put(gsc->clock); - gsc->clock = NULL; - goto err; + return ret; } return 0; - -err: - return -ENXIO; } static int gsc_m2m_suspend(struct gsc_dev *gsc)