From patchwork Wed Mar 9 21:35:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 8550051 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E39BF9F2B4 for ; Wed, 9 Mar 2016 21:39:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 054F0200E9 for ; Wed, 9 Mar 2016 21:39:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 00FC42008F for ; Wed, 9 Mar 2016 21:39:07 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1adlmW-0001Ir-6e; Wed, 09 Mar 2016 21:36:36 +0000 Received: from mail-pf0-x231.google.com ([2607:f8b0:400e:c00::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1adlmA-0001BE-Nl for linux-arm-kernel@lists.infradead.org; Wed, 09 Mar 2016 21:36:16 +0000 Received: by mail-pf0-x231.google.com with SMTP id u190so21398814pfb.3 for ; Wed, 09 Mar 2016 13:35:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eyvGRC9KKiSiJSXUJ8qcI9h4aMsVxiAjF8sH0xlAC6M=; b=mmY8358zqpwEWAYlSyObP2jY+2CwXz58WBaZik9XlOLBnll8YTu90gn1fh/c0zenQQ MbSUhqHpNHHl0rWCGL8NRb/EGGFYioC08xWdaGe7F2r2hlguQRg1lxm8GmRkqSQIzfLb 5rvkBLRb3umXz8pQgNlrifv63ZJIq+gzAm/7eOyU1HGSje50x1lJuxBXQ7Lw3Sw66iqy 0J0oMWF1uz1YYbk/kEtfxNeHdjZ40MvkF1VugXs0xLWDDEeSOAcRpYAaroPXHLMdTaB4 a3iNXdvEXno3q+bqr96N+uuUyc065PzoXfhLP/syGW4JPhEPCfVon1V6Wvq/Yw6kIxzU E2BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=eyvGRC9KKiSiJSXUJ8qcI9h4aMsVxiAjF8sH0xlAC6M=; b=Dw6OTrpgoFcIlcg2goCOV0Nlw7FyKnBgdOqrzE3Cff+rqquNMg7PDSDM3wobgl5rZQ cD3Cjxz/JAUsbwbBdU1yaQR2iS6R2CoTmoVcRYA7y1jw3g9tcFbO/8YqTgkT3qpywvxL H2eWw18B2PECqML/NojloHlCOtP9ad+Vq7+I31/C25QSCGiSH9T6UjnPRU8qTLDZi5A7 0k4DgV4PeioU81Z300xmG1KQOYCIuqBF2q31p26selacoxnMae8XlaWdlCtrbzpa+H30 3Huj25RwD9WODnnr7uVt7E7vUUwY8+2puqKVmwTFV2BvTLbTBWrp0ESfPq+7E1omruoG iCVQ== X-Gm-Message-State: AD7BkJIEnEyScWbFo4EC20+lHjzKlFeQwZcEzka1BrWrgeE3fxnnBRAPzaLibnDPmiLO6Q== X-Received: by 10.98.15.23 with SMTP id x23mr687613pfi.60.1457559354136; Wed, 09 Mar 2016 13:35:54 -0800 (PST) Received: from localhost ([209.119.72.78]) by smtp.gmail.com with ESMTPSA id 22sm376113pfh.48.2016.03.09.13.35.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Mar 2016 13:35:53 -0800 (PST) From: Eduardo Valentin To: Rui Zhang Subject: [PATCH 11/13] thermal: convert exynos to use devm_thermal_zone_of_sensor_register Date: Wed, 9 Mar 2016 13:35:33 -0800 Message-Id: <1457559336-17652-12-git-send-email-edubezval@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1457559336-17652-1-git-send-email-edubezval@gmail.com> References: <1457559336-17652-1-git-send-email-edubezval@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160309_133614_904189_EE1BB871 X-CRM114-Status: GOOD ( 13.81 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lukasz Majewski , linux-samsung-soc@vger.kernel.org, Linux PM , Krzysztof Kozlowski , LKML , lm-sensors@lm-sensors.org, Eduardo Valentin , Kukjin Kim , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This changes the driver to use the devm_ version of thermal_zone_of_sensor_register and cleans up the local points and unregister calls. Cc: Lukasz Majewski Cc: Zhang Rui Cc: Kukjin Kim Cc: Krzysztof Kozlowski Cc: linux-pm@vger.kernel.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin Reviewed-by: Lukasz Majewski --- drivers/thermal/samsung/exynos_tmu.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index fa61eff..256039e 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -1363,8 +1363,8 @@ static int exynos_tmu_probe(struct platform_device *pdev) * data->tzd must be registered before calling exynos_tmu_initialize(), * requesting irq and calling exynos_tmu_control(). */ - data->tzd = thermal_zone_of_sensor_register(&pdev->dev, 0, data, - &exynos_sensor_ops); + data->tzd = devm_thermal_zone_of_sensor_register(&pdev->dev, 0, data, + &exynos_sensor_ops); if (IS_ERR(data->tzd)) { ret = PTR_ERR(data->tzd); dev_err(&pdev->dev, "Failed to register sensor: %d\n", ret); @@ -1374,21 +1374,19 @@ static int exynos_tmu_probe(struct platform_device *pdev) ret = exynos_tmu_initialize(pdev); if (ret) { dev_err(&pdev->dev, "Failed to initialize TMU\n"); - goto err_thermal; + goto err_sclk; } ret = devm_request_irq(&pdev->dev, data->irq, exynos_tmu_irq, IRQF_TRIGGER_RISING | IRQF_SHARED, dev_name(&pdev->dev), data); if (ret) { dev_err(&pdev->dev, "Failed to request irq: %d\n", data->irq); - goto err_thermal; + goto err_sclk; } exynos_tmu_control(pdev, true); return 0; -err_thermal: - thermal_zone_of_sensor_unregister(&pdev->dev, data->tzd); err_sclk: clk_disable_unprepare(data->sclk); err_clk: @@ -1406,9 +1404,7 @@ err_sensor: static int exynos_tmu_remove(struct platform_device *pdev) { struct exynos_tmu_data *data = platform_get_drvdata(pdev); - struct thermal_zone_device *tzd = data->tzd; - thermal_zone_of_sensor_unregister(&pdev->dev, tzd); exynos_tmu_control(pdev, false); clk_disable_unprepare(data->sclk);