From patchwork Thu Apr 18 11:37:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 16237 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ia0-f197.google.com (mail-ia0-f197.google.com [209.85.210.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B489F23974 for ; Thu, 18 Apr 2013 11:50:57 +0000 (UTC) Received: by mail-ia0-f197.google.com with SMTP id r13sf9957754iar.0 for ; Thu, 18 Apr 2013 04:50:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :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 :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=KRuOq9A55Thkrl4kVwLAbyG6mt57b6AqMZgY9t+Ii7E=; b=SfWa4lHWqxl5PzHRyExZ/6kD5Y2uNgok7G3HbmFPpnR6gGcxkMEbRme54mhJ6bAvjf lJnv12b7dZG9rQn129vcK5YLe5WYZmCwJ5t9tIbfpZ/wV65XoHb87Yuf2KCRn/rwRr+C ol7iFZRQMNoU/eoc3LwKlb2lu3EicQBceW4g4/t8mzn8On5IdW750rxDkmGq8pUl+FDD BYxaVX/r+9Qr5nXtRV+Orsy7MhnJtkiEumLfIlyZZSQKIq3YOKNRhJGDmzBNGu9x7Tn5 qWaSAPsc982ni8g9Rx0TPK2F2XVcWRPK/vnS6utG9c/3PpxJ0N0DevqxW104Qh7HlCmV FwqA== X-Received: by 10.182.120.69 with SMTP id la5mr299904obb.47.1366285820302; Thu, 18 Apr 2013 04:50:20 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.47.78 with SMTP id b14ls1344128qen.18.gmail; Thu, 18 Apr 2013 04:50:20 -0700 (PDT) X-Received: by 10.58.173.131 with SMTP id bk3mr7828941vec.48.1366285820100; Thu, 18 Apr 2013 04:50:20 -0700 (PDT) Received: from mail-vb0-x22a.google.com (mail-vb0-x22a.google.com [2607:f8b0:400c:c02::22a]) by mx.google.com with ESMTPS id cs9si6412994vdc.25.2013.04.18.04.50.20 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Apr 2013 04:50:20 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22a is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::22a; Received: by mail-vb0-f42.google.com with SMTP id p12so2269118vbe.1 for ; Thu, 18 Apr 2013 04:50:20 -0700 (PDT) X-Received: by 10.220.242.73 with SMTP id lh9mr7813387vcb.49.1366285819950; Thu, 18 Apr 2013 04:50:19 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp119420veb; Thu, 18 Apr 2013 04:50:19 -0700 (PDT) X-Received: by 10.68.196.65 with SMTP id ik1mr12990313pbc.194.1366285818899; Thu, 18 Apr 2013 04:50:18 -0700 (PDT) Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) by mx.google.com with ESMTPS id im4si8898087pbc.241.2013.04.18.04.50.18 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Apr 2013 04:50:18 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.51 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.51; Received: by mail-pa0-f51.google.com with SMTP id jh10so1538047pab.38 for ; Thu, 18 Apr 2013 04:50:18 -0700 (PDT) X-Received: by 10.66.240.1 with SMTP id vw1mr13051451pac.152.1366285818485; Thu, 18 Apr 2013 04:50:18 -0700 (PDT) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPS id mm9sm9619055pbc.43.2013.04.18.04.50.14 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 18 Apr 2013 04:50:17 -0700 (PDT) From: Sachin Kamat To: linux-pm@vger.kernel.org Cc: rui.zhang@intel.com, eduardo.valentin@ti.com, sachin.kamat@linaro.org, kgene.kim@samsung.com, patches@linaro.org, Amit Daniel Kachhap Subject: [PATCH 1/2] Thermal: exynos: Add clk_{un}prepare APIs Date: Thu, 18 Apr 2013 17:07:58 +0530 Message-Id: <1366285079-10395-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQlHNWY0vs67mULGCQN9aON8RX58hCOF8JUS//8ubX76PBeek+XEPLRlq9tCLavZYwSgsyCi X-Original-Sender: sachin.kamat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22a is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , clk_{un}prepare APIs are required to migrate to common clock framework. While at it convert to use devm_clk_get as it removes some cleanup code. Signed-off-by: Sachin Kamat Cc: Amit Daniel Kachhap Acked-by: Eduardo Valentin --- drivers/thermal/exynos_thermal.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c index e34d842..9df96e5 100644 --- a/drivers/thermal/exynos_thermal.c +++ b/drivers/thermal/exynos_thermal.c @@ -937,12 +937,16 @@ static int exynos_tmu_probe(struct platform_device *pdev) return ret; } - data->clk = clk_get(NULL, "tmu_apbif"); + data->clk = devm_clk_get(&pdev->dev, "tmu_apbif"); if (IS_ERR(data->clk)) { dev_err(&pdev->dev, "Failed to get clock\n"); return PTR_ERR(data->clk); } + ret = clk_prepare(data->clk); + if (ret) + return ret; + if (pdata->type == SOC_ARCH_EXYNOS || pdata->type == SOC_ARCH_EXYNOS4210) data->soc = pdata->type; @@ -994,7 +998,7 @@ static int exynos_tmu_probe(struct platform_device *pdev) return 0; err_clk: platform_set_drvdata(pdev, NULL); - clk_put(data->clk); + clk_unprepare(data->clk); return ret; } @@ -1006,7 +1010,7 @@ static int exynos_tmu_remove(struct platform_device *pdev) exynos_unregister_thermal(); - clk_put(data->clk); + clk_unprepare(data->clk); platform_set_drvdata(pdev, NULL);