From patchwork Tue Oct 3 11:16:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Majewski X-Patchwork-Id: 729180 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6059BE7544D for ; Tue, 3 Oct 2023 11:17:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231452AbjJCLRO (ORCPT ); Tue, 3 Oct 2023 07:17:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239897AbjJCLRN (ORCPT ); Tue, 3 Oct 2023 07:17:13 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FB639B for ; Tue, 3 Oct 2023 04:17:07 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20231003111706euoutp02c5adcfa1b8db4ae170ad82ad676a850a~KlM7--WoJ1082210822euoutp02o for ; Tue, 3 Oct 2023 11:17:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20231003111706euoutp02c5adcfa1b8db4ae170ad82ad676a850a~KlM7--WoJ1082210822euoutp02o DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1696331826; bh=/ca++/KHRk6o53rF+DzbG9/VMb831UCbsayQlJT1j9U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VCFMF3iKQ7alTsayspALx/I9chVxIadsjjVjRlJCNqFR9a7t4fv4GPfOq4oOkimZi lXSPAZ4hGs4Du6Q+ZrVqxZ2Tmkmd7hMrn1yMQZN4/4LcILNcpjHWPAlQ9oa6VHBX0Z lcUObG+EEjvA7OU8xVJAaM9N9uOVt8yzvS9mQtbA= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20231003111706eucas1p1898517e6f35ba51c43e91baa3a3d879b~KlM7uOk_42602126021eucas1p1g; Tue, 3 Oct 2023 11:17:06 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 00.2F.37758.238FB156; Tue, 3 Oct 2023 12:17:06 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20231003111705eucas1p2f47a85d9c53d608654c5957cae88cf60~KlM7RmT7Q2468224682eucas1p2s; Tue, 3 Oct 2023 11:17:05 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20231003111705eusmtrp1ce6d8e66ac6dd31a3c945b2745107f4e~KlM7Q2Qux2246422464eusmtrp1S; Tue, 3 Oct 2023 11:17:05 +0000 (GMT) X-AuditID: cbfec7f5-7ffff7000002937e-d7-651bf832c6af Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id D6.D1.10549.138FB156; Tue, 3 Oct 2023 12:17:05 +0100 (BST) Received: from AMDC4515.eu.corp.samsungelectronics.net (unknown [106.120.51.28]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231003111704eusmtip22bf7e326c87e75be0083e005f8032a34~KlM6fh-e52844228442eusmtip2B; Tue, 3 Oct 2023 11:17:04 +0000 (GMT) From: Mateusz Majewski To: linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Mateusz Majewski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Alim Akhtar , Liam Girdwood , Mark Brown , Marek Szyprowski Subject: [PATCH v3 1/8] thermal: exynos: remove an unnecessary field description Date: Tue, 3 Oct 2023 13:16:27 +0200 Message-ID: <20231003111638.241542-2-m.majewski2@samsung.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231003111638.241542-1-m.majewski2@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrNKsWRmVeSWpSXmKPExsWy7djPc7pGP6RTDU4/Z7F4MG8bm8Xh+RUW Ux8+YbP4vuU6k8W8z7IWe19vZbf4dqWDyWLT42usFpd3zWGz+Nx7hNFixvl9TBYTj01mtlh7 5C67xdwvU5ktnjzsY3Pg99g56y67x+I9L5k8Nq3qZPO4c20Pm8fmJfUefVtWMXp83iQXwB7F ZZOSmpNZllqkb5fAldG0jLtgFXvFiu+bGBsYJ7N1MXJySAiYSExe+4ipi5GLQ0hgBaPE48s7 2SCcL4wS0x5tZQapEhL4zCixc5cqTMfW/9cZIYqWM0q0rznMDOG0Mklc+dXFDlLFJmAg8eDN MjBbRKCVUWJmkzpIEbPAJWaJuzfXsoAkhAWCJGac/wR2CIuAqsTnhkesIDavgK3Eq/fLWCDW yUvsWfSdCcTmFLCTWPlzORNEjaDEyZlPwGqYgWqat84Gu0JCoJlT4sjctUCbOYAcF4lVTQEQ c4QlXh3fwg5hy0icntwDNT9fYsbm9ywQ5RUSdw96QZjWEh/PMIOYzAKaEut36UNEHSXad6tA mHwSN94KQqznk5i0bTozRJhXoqNNCGKyqsTxPZOYIWxpiSctt5kgbA+JJfd72CcwKs5C8sgs JI/MQli7gJF5FaN4amlxbnpqsXFearlecWJucWleul5yfu4mRmD6Ov3v+NcdjCtefdQ7xMjE wXiIUYKDWUmEN+yoVKoQb0piZVVqUX58UWlOavEhRmkOFiVxXm3bk8lCAumJJanZqakFqU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QxMzSwNTSzNjJXFez4KORCGB9MSS1OzU1ILUIpg+Jg5OqQamas4N/tbfVx6ZttKjXa8mJ2ii 7msLWa41m+Qneqr3C+jtm1s439L3teF6iyefb3tNe/HiR+bzXZO28V6NONR+y9Mo89ye7sXx vh93ZrfWcW818jYKzOpS51Ft/y6XtGDf9zbDXRf/LrhwRS8nTUTpwaVz4i2N33+VXuG9fVnL /2ow55r+vlBBpuu3Mo70frlTOs9a+9JJPq3oldckyo7e2cgaYvFnfkLHmqPLgk/Xd6yOfLiw 1GuN8/RztVNuLn/ydN0Cd8YDGVJat7+/Orpo+pbWXwGr5eb1zBNzMI49rGu2pGbrrCuL15Y/ 85tn17vsKNOemlevF5xxPabdqDDr2bwznQ1mQW2NnEdep9nM26nEUpyRaKjFXFScCAAqOo69 QgMAAA== X-CMS-MailID: 20231003111705eucas1p2f47a85d9c53d608654c5957cae88cf60 X-Msg-Generator: CA X-RootMTR: 20231003111705eucas1p2f47a85d9c53d608654c5957cae88cf60 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20231003111705eucas1p2f47a85d9c53d608654c5957cae88cf60 References: <20231003111638.241542-1-m.majewski2@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org It seems that the field has been removed in one of the previous commits, but the description has been forgotten. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Mateusz Majewski --- drivers/thermal/samsung/exynos_tmu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index e5bc2c82010f..2c1cfb8c4b33 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -160,7 +160,6 @@ enum soc_type { * in the positive-TC generator block * 0 < reference_voltage <= 31 * @regulator: pointer to the TMU regulator structure. - * @reg_conf: pointer to structure to register with core thermal. * @tzd: pointer to thermal_zone_device structure * @ntrip: number of supported trip points. * @enabled: current status of TMU device From patchwork Tue Oct 3 11:16:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Majewski X-Patchwork-Id: 729179 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88673E7544B for ; Tue, 3 Oct 2023 11:17:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239958AbjJCLRR (ORCPT ); Tue, 3 Oct 2023 07:17:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239922AbjJCLRO (ORCPT ); Tue, 3 Oct 2023 07:17:14 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 599A4BB for ; Tue, 3 Oct 2023 04:17:10 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20231003111709euoutp01b65c9006091a844ac790126c0cda0c9f~KlM_k2mB70934309343euoutp01j for ; Tue, 3 Oct 2023 11:17:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20231003111709euoutp01b65c9006091a844ac790126c0cda0c9f~KlM_k2mB70934309343euoutp01j DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1696331829; bh=CCUmjPvJE2taTRrp0O0mccb79s4/56wbyFNyGnHqHRc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hdgk0t288TFpR1FJtTet88IP1k8jyy4ZmQZvIR0sdSwoOqvfVz9slUUpdymDO12bM 3wANaMwqSF9btZm4RMG0rV2c3GOiqz8pbGLda7AO57/N0P5Omv3osJEymEfJJuu2na Q6WyQb7WIHGLl0/G4+IGSZeeafUHIy7LPwkfNrZY= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20231003111708eucas1p220d81655676ed79d728ea5a48ab2000a~KlM_I96U70665806658eucas1p2K; Tue, 3 Oct 2023 11:17:08 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 75.14.11320.438FB156; Tue, 3 Oct 2023 12:17:08 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20231003111708eucas1p29eebdad45a2eae16148c9a5dbbcd47eb~KlM9ueQt_2873428734eucas1p2J; Tue, 3 Oct 2023 11:17:08 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20231003111708eusmtrp1557c1b9222630af8ae63b55e44a6e735~KlM9ttFgI2246422464eusmtrp1Z; Tue, 3 Oct 2023 11:17:08 +0000 (GMT) X-AuditID: cbfec7f4-97dff70000022c38-37-651bf8347486 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 3A.D1.10549.438FB156; Tue, 3 Oct 2023 12:17:08 +0100 (BST) Received: from AMDC4515.eu.corp.samsungelectronics.net (unknown [106.120.51.28]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231003111707eusmtip27cb19697124906ee428f70d4b9f2ccf5~KlM874NuU2773227732eusmtip2e; Tue, 3 Oct 2023 11:17:07 +0000 (GMT) From: Mateusz Majewski To: linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Mateusz Majewski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Alim Akhtar , Liam Girdwood , Mark Brown , Marek Szyprowski Subject: [PATCH v3 3/8] thermal: exynos: switch from workqueue-driven interrupt handling to threaded interrupts Date: Tue, 3 Oct 2023 13:16:29 +0200 Message-ID: <20231003111638.241542-4-m.majewski2@samsung.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231003111638.241542-1-m.majewski2@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrHKsWRmVeSWpSXmKPExsWy7djPc7omP6RTDd5f1LB4MG8bm8Xh+RUW Ux8+YbP4vuU6k8W8z7IWe19vZbf4dqWDyWLT42usFpd3zWGz+Nx7hNFixvl9TBYTj01mtlh7 5C67xdwvU5ktnjzsY3Pg99g56y67x+I9L5k8Nq3qZPO4c20Pm8fmJfUefVtWMXp83iQXwB7F ZZOSmpNZllqkb5fAlfHkXCNjwR7Jil1H29kbGCeJdjFyckgImEjMOtLA0sXIxSEksIJRYsuq dkYI5wujRHv/FmYI5zOjxJHOvWwwLbuO/mGDSCxnlHjc84cVwmllkvi3dh8rSBWbgIHEgzfL 2EFsEYFWRomZTeogRcwCl5gl7t5cywKSEBYolJj8ZivYWBYBVYmWFRfBGngFbCXajnSxQqyT l9iz6DsTiM0pYCex8udyJogaQYmTM5+AzWEGqmneOhvsVgmB/xwSG77MgLrVRWLenoNMELaw xKvjW9ghbBmJ05N7WCDsfIkZm98D2RxAdoXE3YNeEKa1xMczzCAms4CmxPpd+hDFjhL/dx6G KuaTuPFWEOIAPolJ26YzQ4R5JTrahCCqVSWO75nEDGFLSzxpuc0EUeIh0bLYZQKj4iwkn8xC 8skshLULGJlXMYqnlhbnpqcWG+WllusVJ+YWl+al6yXn525iBCax0/+Of9nBuPzVR71DjEwc jIcYJTiYlUR4w45KpQrxpiRWVqUW5ccXleakFh9ilOZgURLn1bY9mSwkkJ5YkpqdmlqQWgST ZeLglGpgKpeYdTHkadG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7NcCbkqWTphyKNlkuku3 l+TM++8ESsRb8378VCxS/3rxzmyBtLRPU7e88lheksMqy237dtK7F8/N7t5q9/8aaFxe+enN Lv1bHKcLHm6e+XquVg7zrWLvmE0bb00WilvxZxFLm+OilwKXc9bnlGwOOFHzKUUl5eEnoTt7 FVl7LP07V7b3VhnaL3v54FukxrqzzeXhx5JXca4QFDt2+GPN4/2BKx/39Gxdo5PNdqvU7c+7 vlf/I+tqb/uqzchL0pRo/uhv7HvyyTXOjTn/jixvKNSc+HZVyeyK0//MuJr69P95rFwR9POn GpOPafj9kC37tnTm6WccuPr5TMl/D2HPyQWmqz4yFLXdTph9U4mlOCPRUIu5qDgRANVJxE5C AwAA X-CMS-MailID: 20231003111708eucas1p29eebdad45a2eae16148c9a5dbbcd47eb X-Msg-Generator: CA X-RootMTR: 20231003111708eucas1p29eebdad45a2eae16148c9a5dbbcd47eb X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20231003111708eucas1p29eebdad45a2eae16148c9a5dbbcd47eb References: <20231003111638.241542-1-m.majewski2@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The workqueue boilerplate is mostly one-to-one what the threaded interrupts do. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Mateusz Majewski --- v1 -> v2: devm_request_threaded_irq call formatting change. drivers/thermal/samsung/exynos_tmu.c | 29 +++++++++------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 90c33e8017af..0e970638193d 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -142,7 +142,6 @@ enum soc_type { * @base_second: base address of the common registers of the TMU controller. * @irq: irq number of the TMU controller. * @soc: id of the SOC type. - * @irq_work: pointer to the irq work structure. * @lock: lock to implement synchronization. * @clk: pointer to the clock structure. * @clk_sec: pointer to the clock structure for accessing the base_second. @@ -175,7 +174,6 @@ struct exynos_tmu_data { void __iomem *base_second; int irq; enum soc_type soc; - struct work_struct irq_work; struct mutex lock; struct clk *clk, *clk_sec, *sclk; u32 cal_type; @@ -763,10 +761,9 @@ static int exynos7_tmu_read(struct exynos_tmu_data *data) EXYNOS7_TMU_TEMP_MASK; } -static void exynos_tmu_work(struct work_struct *work) +static irqreturn_t exynos_tmu_threaded_irq(int irq, void *id) { - struct exynos_tmu_data *data = container_of(work, - struct exynos_tmu_data, irq_work); + struct exynos_tmu_data *data = id; thermal_zone_device_update(data->tzd, THERMAL_EVENT_UNSPECIFIED); @@ -778,7 +775,8 @@ static void exynos_tmu_work(struct work_struct *work) clk_disable(data->clk); mutex_unlock(&data->lock); - enable_irq(data->irq); + + return IRQ_HANDLED; } static void exynos4210_tmu_clear_irqs(struct exynos_tmu_data *data) @@ -812,16 +810,6 @@ static void exynos4210_tmu_clear_irqs(struct exynos_tmu_data *data) writel(val_irq, data->base + tmu_intclear); } -static irqreturn_t exynos_tmu_irq(int irq, void *id) -{ - struct exynos_tmu_data *data = id; - - disable_irq_nosync(irq); - schedule_work(&data->irq_work); - - return IRQ_HANDLED; -} - static const struct of_device_id exynos_tmu_match[] = { { .compatible = "samsung,exynos3250-tmu", @@ -1023,8 +1011,6 @@ static int exynos_tmu_probe(struct platform_device *pdev) if (ret) goto err_sensor; - INIT_WORK(&data->irq_work, exynos_tmu_work); - data->clk = devm_clk_get(&pdev->dev, "tmu_apbif"); if (IS_ERR(data->clk)) { dev_err(&pdev->dev, "Failed to get clock\n"); @@ -1093,8 +1079,11 @@ static int exynos_tmu_probe(struct platform_device *pdev) goto err_sclk; } - ret = devm_request_irq(&pdev->dev, data->irq, exynos_tmu_irq, - IRQF_TRIGGER_RISING | IRQF_SHARED, dev_name(&pdev->dev), data); + ret = devm_request_threaded_irq(&pdev->dev, data->irq, NULL, + exynos_tmu_threaded_irq, + IRQF_TRIGGER_RISING + | IRQF_SHARED | IRQF_ONESHOT, + dev_name(&pdev->dev), data); if (ret) { dev_err(&pdev->dev, "Failed to request irq: %d\n", data->irq); goto err_sclk; From patchwork Tue Oct 3 11:16:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Majewski X-Patchwork-Id: 729178 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 404A2E75451 for ; Tue, 3 Oct 2023 11:17:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239955AbjJCLRT (ORCPT ); Tue, 3 Oct 2023 07:17:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239929AbjJCLRR (ORCPT ); Tue, 3 Oct 2023 07:17:17 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 462C7C4 for ; Tue, 3 Oct 2023 04:17:13 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20231003111712euoutp027fcbecab7b1bd9fe959b90802cc69fc6~KlNBSlvcC1049610496euoutp027 for ; Tue, 3 Oct 2023 11:17:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20231003111712euoutp027fcbecab7b1bd9fe959b90802cc69fc6~KlNBSlvcC1049610496euoutp027 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1696331832; bh=V2/Mzb3I7DEQaqQIC0PslVbUjHF4j1Sq8nv+9t2b3y0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ID8Z0dMgZk+xiF2qNL2+N6JaBTVz382TOqb5TM/xLHmD7qDMPhtEm3fGceNm90zfS FsVx34UX8I+7D5i4c5fN5mnl4p1i7Ee5PHyqX4RcgCx/HCuhKK3rNo5qOdPzPa2vLg H9QUV2HqJNoIEujnW73FVqm8EsS9Jbpj/nW4m80o= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20231003111711eucas1p1628e726b548802c3befcd088761ae329~KlNA48lQA2460224602eucas1p1x; Tue, 3 Oct 2023 11:17:11 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id D4.2F.37758.738FB156; Tue, 3 Oct 2023 12:17:11 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20231003111711eucas1p2646dcfd2d7d473b78b012153bca06cc7~KlNASNH_30433204332eucas1p2N; Tue, 3 Oct 2023 11:17:11 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20231003111711eusmtrp1323c66d180ae07f5752a597299e8ac54~KlNARkQSH2239722397eusmtrp1B; Tue, 3 Oct 2023 11:17:11 +0000 (GMT) X-AuditID: cbfec7f5-7ffff7000002937e-e5-651bf837e354 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 80.DE.25043.638FB156; Tue, 3 Oct 2023 12:17:10 +0100 (BST) Received: from AMDC4515.eu.corp.samsungelectronics.net (unknown [106.120.51.28]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231003111710eusmtip2f6c814e4b6d39c4deec3ca73aa73b069~KlM-ax1nA2844228442eusmtip2E; Tue, 3 Oct 2023 11:17:10 +0000 (GMT) From: Mateusz Majewski To: linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Mateusz Majewski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Alim Akhtar , Liam Girdwood , Mark Brown , Marek Szyprowski Subject: [PATCH v3 5/8] thermal: exynos: simplify regulator (de)initialization Date: Tue, 3 Oct 2023 13:16:31 +0200 Message-ID: <20231003111638.241542-6-m.majewski2@samsung.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231003111638.241542-1-m.majewski2@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLKsWRmVeSWpSXmKPExsWy7djP87rmP6RTDT5sULZ4MG8bm8Xh+RUW Ux8+YbP4vuU6k8W8z7IWe19vZbf4dqWDyWLT42usFpd3zWGz+Nx7hNFixvl9TBYTj01mtlh7 5C67xdwvU5ktnjzsY3Pg99g56y67x+I9L5k8Nq3qZPO4c20Pm8fmJfUefVtWMXp83iQXwB7F ZZOSmpNZllqkb5fAlXH3xTGWgu2yFUvX32JvYLwk3sXIwSEhYCKxY1VuFyMXh5DACkaJ768X MEM4Xxgl5k14zQjhfGaUmLZxIZDDCdYxq68Jqmo5o8SZZb+hnFYmiY/fF7CBVLEJGEg8eLOM HcQWEWhllJjZpA5SxCxwiVni7s21LCAJYYEAic43DWBjWQRUJT7+/QPWzCtgK/Fu6XZ2iHXy EnsWfWcCsTkF7CRW/lzOBFEjKHFy5hOwOcxANc1bZ4NdISHQzCnx9OEeJohmF4m9/25CDRKW eHV8C5QtI3F6cg8LhJ0vMWPzexZIaFRI3D3oBWFaS3w8wwxiMgtoSqzfpQ9R7Cix5P8rdogK PokbbwUhDuCTmLRtOjNEmFeio00IolpV4vieScwQtrTEk5bbTBAlHhKntmhOYFScheSTWUg+ mYWwdgEj8ypG8dTS4tz01GLjvNRyveLE3OLSvHS95PzcTYzAFHb63/GvOxhXvPqod4iRiYPx EKMEB7OSCG/YUalUId6UxMqq1KL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TEyqrUovz4otKc1OJDjKZAd09klhJNzgdGfV5JvKGZ gamhiZmlgamlmbGSOK9nQUeikEB6YklqdmpqQWoRTB8TB6dUA1NBnW/gW1bl+E6XnT+rq7bv WFyZI2sc8lKDdd7p+w78wb9vCHjLH8h5WLTEpT3jh1vucc0z0zRDn+k72fdJMm53Pbr/1nmL j8e+6Fxpmc75obiZN2it0dNlZ9TaVZfkWm8oMPkbdsLVJfVsTOXvjUfS1CeWVx4rurbg8r2l s468NmjbuNlsfaPJc6He1zx56qLdVTXeiY+Up13hfb5CfcKK+6bfj6t+L/+TlL/Zm3vl41Wx 7ItOiswRWxC40OPiis8N/xfMn5Cuq3u25urlG40rEm9HKnpJp531OHZijlZK+vsfX790zDpZ Zvj33PF+o1Tj+/Y1Dfo5vL61K3dKLlJmdQhNOrvKaVXqbavAvE9KLMUZiYZazEXFiQCZM+zK QgMAAA== X-CMS-MailID: 20231003111711eucas1p2646dcfd2d7d473b78b012153bca06cc7 X-Msg-Generator: CA X-RootMTR: 20231003111711eucas1p2646dcfd2d7d473b78b012153bca06cc7 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20231003111711eucas1p2646dcfd2d7d473b78b012153bca06cc7 References: <20231003111638.241542-1-m.majewski2@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org We rewrite the initialization to enable the regulator as part of devm, which allows us to not handle the struct instance manually. We also remove the error message in case the regulator is unavailable, as this is expected behaviour. Signed-off-by: Mateusz Majewski Reviewed-by: Krzysztof Kozlowski --- v2 -> v3: fixed error handling of devm_regulator_get_optional to handle the case in which the regulator is available, but enabling it fails. Also removed the error message, split into two commits and reworded the commit message. drivers/thermal/samsung/exynos_tmu.c | 49 +++++++++------------------- 1 file changed, 15 insertions(+), 34 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 6070b03cff9d..a0a1f7e1e63f 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -157,7 +157,6 @@ enum soc_type { * @reference_voltage: reference voltage of amplifier * in the positive-TC generator block * 0 < reference_voltage <= 31 - * @regulator: pointer to the TMU regulator structure. * @tzd: pointer to thermal_zone_device structure * @ntrip: number of supported trip points. * @enabled: current status of TMU device @@ -183,7 +182,6 @@ struct exynos_tmu_data { u16 temp_error1, temp_error2; u8 gain; u8 reference_voltage; - struct regulator *regulator; struct thermal_zone_device *tzd; unsigned int ntrip; bool enabled; @@ -994,50 +992,40 @@ static int exynos_tmu_probe(struct platform_device *pdev) * TODO: Add regulator as an SOC feature, so that regulator enable * is a compulsory call. */ - data->regulator = devm_regulator_get_optional(&pdev->dev, "vtmu"); - if (!IS_ERR(data->regulator)) { - ret = regulator_enable(data->regulator); - if (ret) { - dev_err(&pdev->dev, "failed to enable vtmu\n"); - return ret; - } - } else { - ret = PTR_ERR(data->regulator); - switch (ret) { - case -ENODEV: - break; - case -EPROBE_DEFER: - return -EPROBE_DEFER; - default: - dev_err(&pdev->dev, "Failed to get regulator: %d\n", - ret); - return ret; - } + ret = devm_regulator_get_enable_optional(&pdev->dev, "vtmu"); + switch (ret) { + case 0: + case -ENODEV: + break; + case -EPROBE_DEFER: + return -EPROBE_DEFER; + default: + dev_err(&pdev->dev, "Failed to get enabled regulator: %d\n", + ret); + return ret; } ret = exynos_map_dt_data(pdev); if (ret) - goto err_sensor; + return ret; data->clk = devm_clk_get(&pdev->dev, "tmu_apbif"); if (IS_ERR(data->clk)) { dev_err(&pdev->dev, "Failed to get clock\n"); - ret = PTR_ERR(data->clk); - goto err_sensor; + return PTR_ERR(data->clk); } data->clk_sec = devm_clk_get(&pdev->dev, "tmu_triminfo_apbif"); if (IS_ERR(data->clk_sec)) { if (data->soc == SOC_ARCH_EXYNOS5420_TRIMINFO) { dev_err(&pdev->dev, "Failed to get triminfo clock\n"); - ret = PTR_ERR(data->clk_sec); - goto err_sensor; + return PTR_ERR(data->clk_sec); } } else { ret = clk_prepare(data->clk_sec); if (ret) { dev_err(&pdev->dev, "Failed to get clock\n"); - goto err_sensor; + return ret; } } @@ -1107,10 +1095,6 @@ static int exynos_tmu_probe(struct platform_device *pdev) err_clk_sec: if (!IS_ERR(data->clk_sec)) clk_unprepare(data->clk_sec); -err_sensor: - if (!IS_ERR(data->regulator)) - regulator_disable(data->regulator); - return ret; } @@ -1125,9 +1109,6 @@ static int exynos_tmu_remove(struct platform_device *pdev) if (!IS_ERR(data->clk_sec)) clk_unprepare(data->clk_sec); - if (!IS_ERR(data->regulator)) - regulator_disable(data->regulator); - return 0; } From patchwork Tue Oct 3 11:16:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Majewski X-Patchwork-Id: 729177 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0165E75454 for ; Tue, 3 Oct 2023 11:17:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240465AbjJCLRV (ORCPT ); Tue, 3 Oct 2023 07:17:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239963AbjJCLRU (ORCPT ); Tue, 3 Oct 2023 07:17:20 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAA7CB7 for ; Tue, 3 Oct 2023 04:17:16 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20231003111715euoutp012238ab4d91312053623918c289ca6606~KlNEieAAp1141711417euoutp01z for ; Tue, 3 Oct 2023 11:17:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20231003111715euoutp012238ab4d91312053623918c289ca6606~KlNEieAAp1141711417euoutp01z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1696331835; bh=KJozKF3tDwxVWSXlQ/ef+TTDcYyB/rkSZst7Qpw6Axc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lsRLzs8ubE9rRu4UegkLic+WqWUd/t5uC36VuDjypDdtCEAadfFrxSyYAsMETyYHC 4wECbnnod1oPyzNfxsFWZEhughdNeSYVTrnNgBIej3BN0+u6v/WmvPE5L3UTa9M9fI hH5ppIID2uTHCbNVjLwwbEdnomzUJ2zRg2Ija3Rk= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20231003111714eucas1p29e6ebbdefd687adbd93ea166433e7ed9~KlNDLbY_v2468224682eucas1p2A; Tue, 3 Oct 2023 11:17:14 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 8A.14.11320.A38FB156; Tue, 3 Oct 2023 12:17:14 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20231003111713eucas1p27fcc64df0091b6097461f28b05bf772a~KlNCtkiRc2872628726eucas1p2a; Tue, 3 Oct 2023 11:17:13 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20231003111713eusmtrp167ee5936eac0aed120e54207fe9c946c~KlNCqkHN42246422464eusmtrp1o; Tue, 3 Oct 2023 11:17:13 +0000 (GMT) X-AuditID: cbfec7f4-97dff70000022c38-4c-651bf83a4dc0 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 20.E1.10549.938FB156; Tue, 3 Oct 2023 12:17:13 +0100 (BST) Received: from AMDC4515.eu.corp.samsungelectronics.net (unknown [106.120.51.28]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231003111712eusmtip272573f24002e37035f6c8fd926410db5~KlNB1KmUM2844228442eusmtip2F; Tue, 3 Oct 2023 11:17:12 +0000 (GMT) From: Mateusz Majewski To: linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Mateusz Majewski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Alim Akhtar , Liam Girdwood , Mark Brown , Marek Szyprowski Subject: [PATCH v3 7/8] thermal: exynos: split initialization of TMU and the thermal zone Date: Tue, 3 Oct 2023 13:16:33 +0200 Message-ID: <20231003111638.241542-8-m.majewski2@samsung.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231003111638.241542-1-m.majewski2@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLKsWRmVeSWpSXmKPExsWy7djP87pWP6RTDRa2s1o8mLeNzeLw/AqL qQ+fsFl833KdyWLeZ1mLva+3slt8u9LBZLHp8TVWi8u75rBZfO49wmgx4/w+JouJxyYzW6w9 cpfdYu6XqcwWTx72sTnwe+ycdZfdY/Gel0wem1Z1snncubaHzWPzknqPvi2rGD0+b5ILYI/i sklJzcksSy3St0vgyni1dytzwUS1ii8HrjI2MP6Q62Lk5JAQMJHY1XODsYuRi0NIYAWjxOZN E5lBEkICXxglrt/ygUh8ZpRYf2gdC0zH69MnWCESyxklFt06zwTR0cokseScNojNJmAg8eDN MnYQW0SglVFiZpM6SAOzwCVmibs314JNEhaIlvj5dh1YEYuAqsS+PefABvEK2ErM/P6dCWKb vMSeRRA2p4CdxMqfy6FqBCVOznwCNocZqKZ562xmkAUSAv85JF483c4G0ewiMXVdBzuELSzx 6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Ak2AQOJB2+WsYMkRAQ6GSW6Np9jAkkwC9xilrj/WgvEFhaIlGicM4cRxGYR UJXYtweihlfAVmLm9+9MEBvkJfYsgrA5BewkVv5cDmYLAdXcWr6PBaJeUOLkzCcsEPPlJZq3 zmaewCgwC0lqFpLUAkamVYwiqaXFuem5xYZ6xYm5xaV56XrJ+bmbGIFRt+3Yz807GOe9+qh3 iJGJg/EQowQHs5IIb9hRqVQh3pTEyqrUovz4otKc1OJDjKZAd09klhJNzgfGfV5JvKGZgamh iZmlgamlmbGSOK9nQUeikEB6YklqdmpqQWoRTB8TB6dUA5OBU+oJXa2dJrcY/HMtefLTX/rX FWobuM4uM054G7DSZLvc2j2P90dly7GFKfXtiL9wkr3TXji5hVti6l6f+GUhj1ufnlbiWp3v U/nVdELVhbkLSuem3zx/onSK5cpDmxddOTDpr++OolN7WWN/LD11eU565Und9cx/VWZrLJro bhR7QcuTt0DL0iRR+Evq7jvu9T0z3+5eYHjXYefnNFbd5Uuzrt5gmmxo9nrKict9MyxahCIs b7ZuzZ/TfLCueH5w5ETzqUJVfTuumX5JN+OZ8Hylr8Q3xglX9z3aZCjBVLvzccqH9+s5j5u7 Pi/JyfkcpXj1dvJzRzPea2/Xna1qUt/z7K3LxF7p3eWxaz2VWIozEg21mIuKEwEWHvKgQwMA AA== X-CMS-MailID: 20231003111713eucas1p27fcc64df0091b6097461f28b05bf772a X-Msg-Generator: CA X-RootMTR: 20231003111713eucas1p27fcc64df0091b6097461f28b05bf772a X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20231003111713eucas1p27fcc64df0091b6097461f28b05bf772a References: <20231003111638.241542-1-m.majewski2@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This will be needed in the future, as the thermal zone subsystem might call our callbacks right after devm_thermal_of_zone_register. Currently we just make get_temp return EAGAIN in such case, but this will not be possible with state-modifying callbacks, for instance set_trips. Signed-off-by: Mateusz Majewski Reviewed-by: Krzysztof Kozlowski --- v1 -> v2: We take clocks into account; exynos_tmu_initialize needs both clocks, as tmu_initialize might use the base_second registers. However, exynos_thermal_zone_configure only needs clk. drivers/thermal/samsung/exynos_tmu.c | 104 +++++++++++++++------------ 1 file changed, 60 insertions(+), 44 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 7138e001fa5a..343e27c61528 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -251,25 +251,8 @@ static void sanitize_temp_error(struct exynos_tmu_data *data, u32 trim_info) static int exynos_tmu_initialize(struct platform_device *pdev) { struct exynos_tmu_data *data = platform_get_drvdata(pdev); - struct thermal_zone_device *tzd = data->tzd; - int num_trips = thermal_zone_get_num_trips(tzd); unsigned int status; - int ret = 0, temp; - - ret = thermal_zone_get_crit_temp(tzd, &temp); - if (ret && data->soc != SOC_ARCH_EXYNOS5433) { /* FIXME */ - dev_err(&pdev->dev, - "No CRITICAL trip point defined in device tree!\n"); - goto out; - } - - if (num_trips > data->ntrip) { - dev_info(&pdev->dev, - "More trip points than supported by this TMU.\n"); - dev_info(&pdev->dev, - "%d trip points should be configured in polling mode.\n", - num_trips - data->ntrip); - } + int ret = 0; mutex_lock(&data->lock); clk_enable(data->clk); @@ -280,32 +263,63 @@ static int exynos_tmu_initialize(struct platform_device *pdev) if (!status) { ret = -EBUSY; } else { - int i, ntrips = - min_t(int, num_trips, data->ntrip); - data->tmu_initialize(pdev); - - /* Write temperature code for rising and falling threshold */ - for (i = 0; i < ntrips; i++) { - - struct thermal_trip trip; - - ret = thermal_zone_get_trip(tzd, i, &trip); - if (ret) - goto err; - - data->tmu_set_trip_temp(data, i, trip.temperature / MCELSIUS); - data->tmu_set_trip_hyst(data, i, trip.temperature / MCELSIUS, - trip.hysteresis / MCELSIUS); - } - data->tmu_clear_irqs(data); } + + mutex_unlock(&data->lock); + clk_disable(data->clk); + if (!IS_ERR(data->clk_sec)) + clk_disable(data->clk_sec); + + return ret; +} + +static int exynos_thermal_zone_configure(struct platform_device *pdev) +{ + struct exynos_tmu_data *data = platform_get_drvdata(pdev); + struct thermal_zone_device *tzd = data->tzd; + int i, num_trips = thermal_zone_get_num_trips(tzd); + int ret = 0, temp; + + ret = thermal_zone_get_crit_temp(tzd, &temp); + + if (ret && data->soc != SOC_ARCH_EXYNOS5433) { /* FIXME */ + dev_err(&pdev->dev, + "No CRITICAL trip point defined in device tree!\n"); + goto out; + } + + mutex_lock(&data->lock); + + if (num_trips > data->ntrip) { + dev_info(&pdev->dev, + "More trip points than supported by this TMU.\n"); + dev_info(&pdev->dev, + "%d trip points should be configured in polling mode.\n", + num_trips - data->ntrip); + } + + clk_enable(data->clk); + + num_trips = min_t(int, num_trips, data->ntrip); + + /* Write temperature code for rising and falling threshold */ + for (i = 0; i < num_trips; i++) { + struct thermal_trip trip; + + ret = thermal_zone_get_trip(tzd, i, &trip); + if (ret) + goto err; + + data->tmu_set_trip_temp(data, i, trip.temperature / MCELSIUS); + data->tmu_set_trip_hyst(data, i, trip.temperature / MCELSIUS, + trip.hysteresis / MCELSIUS); + } + err: clk_disable(data->clk); mutex_unlock(&data->lock); - if (!IS_ERR(data->clk_sec)) - clk_disable(data->clk_sec); out: return ret; } @@ -1044,10 +1058,12 @@ static int exynos_tmu_probe(struct platform_device *pdev) break; } - /* - * data->tzd must be registered before calling exynos_tmu_initialize(), - * requesting irq and calling exynos_tmu_control(). - */ + ret = exynos_tmu_initialize(pdev); + if (ret) { + dev_err(&pdev->dev, "Failed to initialize TMU\n"); + return ret; + } + data->tzd = devm_thermal_of_zone_register(&pdev->dev, 0, data, &exynos_sensor_ops); if (IS_ERR(data->tzd)) { @@ -1058,9 +1074,9 @@ static int exynos_tmu_probe(struct platform_device *pdev) goto err_sclk; } - ret = exynos_tmu_initialize(pdev); + ret = exynos_thermal_zone_configure(pdev); if (ret) { - dev_err(&pdev->dev, "Failed to initialize TMU\n"); + dev_err(&pdev->dev, "Failed to configure the thermal zone\n"); goto err_sclk; }