From patchwork Fri Nov 23 04:45:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 13114 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 5167323E13 for ; Fri, 23 Nov 2012 04:51:34 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id F0C96A187B3 for ; Fri, 23 Nov 2012 04:51:33 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so3555712iag.11 for ; Thu, 22 Nov 2012 20:51:33 -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=6/4vH9vhU47lKre9pO3cMdXj5rkiTeHpVCzF5ZDPUJE=; b=ezGOVQ0zHKx4BqqgseuQ1xLggCBTmuR+rQsDfGo3nAVRVXHAXW4At1srY13XQwHCY3 9DrtU4USLTyoO5TakKnWa5AFygwoMq/6c5gUr44a8mVr1WwelM68nQhouMtm3bN20nl2 hcgGnaHTNpBDG9xEc4x+j7VkkBVW4Mfps0VrhCsxDhmmSmIrmt+BZRaSGa3RyYXvdkGz TQDZTg8buV2w+H7+0YQsZ6tOvtbK/I/cddXO1fD21bB8eT1QW5CYH2VxKtxwg6VrcmSs ThP950tmQ3NFnwDVSNnC4iW9N5kplEZ36kgn8kYuwpRmy6aSrGR69cVqYaV3sUi10nW7 5r8g== Received: by 10.50.42.168 with SMTP id p8mr2442885igl.57.1353646293714; Thu, 22 Nov 2012 20:51:33 -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 n20csp301277igt; Thu, 22 Nov 2012 20:51:33 -0800 (PST) Received: by 10.68.131.8 with SMTP id oi8mr11040300pbb.29.1353646293257; Thu, 22 Nov 2012 20:51:33 -0800 (PST) Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by mx.google.com with ESMTPS id ka8si7466218pbc.35.2012.11.22.20.51.33 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Nov 2012 20:51:33 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.43 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.43; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.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-pa0-f43.google.com with SMTP id fb10so4440575pad.16 for ; Thu, 22 Nov 2012 20:51:33 -0800 (PST) Received: by 10.68.223.131 with SMTP id qu3mr10497995pbc.89.1353646293018; Thu, 22 Nov 2012 20:51:33 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id x8sm3029746paw.16.2012.11.22.20.51.28 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Nov 2012 20:51:32 -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 3/4] [media] exynos-gsc: Use devm_clk_get() Date: Fri, 23 Nov 2012 10:15:01 +0530 Message-Id: <1353645902-7467-4-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1353645902-7467-1-git-send-email-sachin.kamat@linaro.org> References: <1353645902-7467-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQmsP7m5gpMcZvCbLsLR38usK1b8+vqpSsUSXR6139840VMNVVrAgB6Vkg810/jUq4YKhu7C 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 | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c index 99ee1a9..b89afec 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,7 +1014,7 @@ 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); @@ -1027,8 +1025,6 @@ static int gsc_clk_get(struct gsc_dev *gsc) 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; }