From patchwork Sun Jul 14 11:42:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Rapha=C3=ABl_Gallais-Pou?= X-Patchwork-Id: 13732684 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3B8B4C3DA42 for ; Sun, 14 Jul 2024 11:44:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wOp5UqGNK/+aHc+mtLWt/FVtlNV3iPD/WbMrczGg2CE=; b=Cbz4Rb8zBqAyDAMuK3FBhEDHA0 5G+haoKbrI8KbkJW5XxfMYg7Y9kffrYEFJrUGtSb6JU9a1vImWa7uZkCzzHrWLNjk+FtD9xHNpkmt WkYmyUrvaVT3qghMcgFxhdJ55fyGusNPxgExsrA5N1AqYVxlwTbmZ3zFNi7o0rGzqXFhxDLre8uyJ HKFLQPmZgbJREWau6Uz15IACwddx6/Q+XZrzDMl+WdfzDkSz7TP1YXspqk6QOu4lCwL0IFnUC9z3F a5hrKJuh09Fvsj8qLbvIub71r35CKmMsdBTM65POiHAhOz5nTXCv85qSxbUCoan/gEvtOd8cvqBJj 2txgUnJw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSxdv-00000004Lhx-3w6L; Sun, 14 Jul 2024 11:43:51 +0000 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSxdM-00000004LY1-1IMg for linux-arm-kernel@lists.infradead.org; Sun, 14 Jul 2024 11:43:18 +0000 Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-52e99060b0dso3624732e87.1 for ; Sun, 14 Jul 2024 04:43:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720957394; x=1721562194; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=wOp5UqGNK/+aHc+mtLWt/FVtlNV3iPD/WbMrczGg2CE=; b=eyDfjmdiq4cqGwIg6VJPXC0/LecgG3k6EYkpmo3LJxVQJ9o9+JrUAGadzhSnf0av2s hmyRPundPhqneLIAsZPeJKslm1lWygvECPxDqSbGgSE83TTDDDGnOqqV1T/gNJbV9NgC ts3W6KWK3a4GwCN15qKxdHA30xujcrR2Y9IKdJ9RJV7pvTRgx0dRMot5u7eIDTbrQ5EX jK6jT5aAgN4AOtfFNCa9EQxgxpbZF8rHUklR5YeYCvDEoA6gBO37xgbY2tJNzSfNtV/g MRCpeyUBp/KQe4rMGb3SUShfA7g2ylUhwyIeb96GwlJ8Rz8dYV/ajc5dZyTo6ovUqLxP 4znQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720957394; x=1721562194; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wOp5UqGNK/+aHc+mtLWt/FVtlNV3iPD/WbMrczGg2CE=; b=nAs6DZmBnZziM/Z3jgjZgRnL8ynt5Avqm/2IdPxMclHr2VFu+2+gUeXZtSylgNreKL cPi9c9PobYpJ9H5BYvWVZQZg3m4vx8TYYxzDZntOqtRjjjhSCT/30sxmB/CsvDLxgCqi 9ZYiOxSpRtZUKx9a5ctvue5g2aJtgQETW3Ufz/d7xzDjT+qyhIzT1SjvopiihmMGtLCC pX1W/Rev9yCinroAjQ434DFQHqYSUdKRThv6yzM0JvHSSfrDKHH5/5LvcaSaxYX4E/aX OcQCug7ztxpJPhQIKM5JG7SGV6XHCgWAIT+EyUGXhmk2loF3VCqB2YtlqeG59WX2LcDl Hi3w== X-Forwarded-Encrypted: i=1; AJvYcCXEw0BuOdx9cWE5LyL13JG4mWMe0Zk83h2GcIcYS2IANNYNel0v0nIcejrAZXz+tFwgi5CvA+bkazlADvxodvS5dcwleMtCiZzZrDMIV01lsc5sSCM= X-Gm-Message-State: AOJu0Yy8p+79kU1ivk6ExJrumZJj/kw56qlbwgnM0xqRtYD2O+baavQU uryU+JmnfoMp6UUmBecqEpTwevDxZizj1cxddO6JYWwHSPLXEx6N X-Google-Smtp-Source: AGHT+IGzQSl96QOLEDaGbFjBPAymg5u1VSljhpz6IWeZ7P97LOYVU2MHyNNINrbBaBgAgukwbohIfw== X-Received: by 2002:a05:6512:39ce:b0:52e:96d7:2f3a with SMTP id 2adb3069b0e04-52eb99da148mr12221457e87.58.1720957393616; Sun, 14 Jul 2024 04:43:13 -0700 (PDT) Received: from localhost ([2001:861:3385:e20:6384:4cf:52c5:3194]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3680dab3f2esm3650922f8f.18.2024.07.14.04.43.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jul 2024 04:43:13 -0700 (PDT) From: Raphael Gallais-Pou Date: Sun, 14 Jul 2024 13:42:45 +0200 Subject: [PATCH v3 1/2] thermal: st: switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() MIME-Version: 1.0 Message-Id: <20240714-thermal-v3-1-88f2489ef7d5@gmail.com> References: <20240714-thermal-v3-0-88f2489ef7d5@gmail.com> In-Reply-To: <20240714-thermal-v3-0-88f2489ef7d5@gmail.com> To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Maxime Coquelin , Alexandre Torgue , Patrice Chotard , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org X-Mailer: b4 0.14.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240714_044316_412534_D31D4F1E X-CRM114-Status: GOOD ( 15.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Letting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards. Remove those guards on every ST thermal related drivers. Reviewed-by: Patrice Chotard Signed-off-by: Raphael Gallais-Pou --- drivers/thermal/st/st_thermal.c | 4 +--- drivers/thermal/st/st_thermal_memmap.c | 2 +- drivers/thermal/st/stm_thermal.c | 8 +++----- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/thermal/st/st_thermal.c b/drivers/thermal/st/st_thermal.c index 2a105409864e..5f33543a3a54 100644 --- a/drivers/thermal/st/st_thermal.c +++ b/drivers/thermal/st/st_thermal.c @@ -236,7 +236,6 @@ void st_thermal_unregister(struct platform_device *pdev) } EXPORT_SYMBOL_GPL(st_thermal_unregister); -#ifdef CONFIG_PM_SLEEP static int st_thermal_suspend(struct device *dev) { struct st_thermal_sensor *sensor = dev_get_drvdata(dev); @@ -265,9 +264,8 @@ static int st_thermal_resume(struct device *dev) return 0; } -#endif -SIMPLE_DEV_PM_OPS(st_thermal_pm_ops, st_thermal_suspend, st_thermal_resume); +DEFINE_SIMPLE_DEV_PM_OPS(st_thermal_pm_ops, st_thermal_suspend, st_thermal_resume); EXPORT_SYMBOL_GPL(st_thermal_pm_ops); MODULE_AUTHOR("STMicroelectronics (R&D) Limited "); diff --git a/drivers/thermal/st/st_thermal_memmap.c b/drivers/thermal/st/st_thermal_memmap.c index 29c2269b0fb3..28b380013956 100644 --- a/drivers/thermal/st/st_thermal_memmap.c +++ b/drivers/thermal/st/st_thermal_memmap.c @@ -180,7 +180,7 @@ static void st_mmap_remove(struct platform_device *pdev) static struct platform_driver st_mmap_thermal_driver = { .driver = { .name = "st_thermal_mmap", - .pm = &st_thermal_pm_ops, + .pm = pm_sleep_ptr(&st_thermal_pm_ops), .of_match_table = st_mmap_thermal_of_match, }, .probe = st_mmap_probe, diff --git a/drivers/thermal/st/stm_thermal.c b/drivers/thermal/st/stm_thermal.c index 34785b9276fc..ffd988600ed6 100644 --- a/drivers/thermal/st/stm_thermal.c +++ b/drivers/thermal/st/stm_thermal.c @@ -440,7 +440,6 @@ static int stm_thermal_prepare(struct stm_thermal_sensor *sensor) return ret; } -#ifdef CONFIG_PM_SLEEP static int stm_thermal_suspend(struct device *dev) { struct stm_thermal_sensor *sensor = dev_get_drvdata(dev); @@ -466,10 +465,9 @@ static int stm_thermal_resume(struct device *dev) return 0; } -#endif /* CONFIG_PM_SLEEP */ -static SIMPLE_DEV_PM_OPS(stm_thermal_pm_ops, - stm_thermal_suspend, stm_thermal_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(stm_thermal_pm_ops, + stm_thermal_suspend, stm_thermal_resume); static const struct thermal_zone_device_ops stm_tz_ops = { .get_temp = stm_thermal_get_temp, @@ -580,7 +578,7 @@ static void stm_thermal_remove(struct platform_device *pdev) static struct platform_driver stm_thermal_driver = { .driver = { .name = "stm_thermal", - .pm = &stm_thermal_pm_ops, + .pm = pm_sleep_ptr(&stm_thermal_pm_ops), .of_match_table = stm_thermal_of_match, }, .probe = stm_thermal_probe, From patchwork Sun Jul 14 11:42:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Rapha=C3=ABl_Gallais-Pou?= X-Patchwork-Id: 13732688 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 48945C3DA49 for ; Sun, 14 Jul 2024 11:44:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=voezqBRIqgR1xMbzJXPZuwUUHTRBRdZ/+JwyhtZNvfc=; b=5AtctSsz7W2CcFapelYk4kXxos zMc1xTUFVuf5hoHpsDktTXW4wmrpIiAq3ZaVrO68tRMSMizQ/AwQyzWIBIJBCFsvaStL47kL/AFcV RxFYYofKyWIO0LhNzrPE8jerHwfSZiMoQhVmhiiZUwZfIIqT0XkZ920/KqLg2JLXKzz4EqKkrUqM5 V4DsxMYzaeQRIiszL2E23l6kYE43yWIXiUT1n/aC+Fp69bIJTWg2rgyvkn9TmOV2TjX3B9UEGJMQp U5E39qPhobqZC1o1D8e2VoeLIwX7GS7MW+fI+Odju+39EXpCX6y5MyuWO7gyWSkP55Mu7EgIPLa+s NAlCewVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSxeC-00000004LoO-0Txw; Sun, 14 Jul 2024 11:44:08 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSxdN-00000004LY3-0KiY for linux-arm-kernel@lists.infradead.org; Sun, 14 Jul 2024 11:43:19 +0000 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-367ac08f80fso1822330f8f.1 for ; Sun, 14 Jul 2024 04:43:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720957395; x=1721562195; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=voezqBRIqgR1xMbzJXPZuwUUHTRBRdZ/+JwyhtZNvfc=; b=TUNgURr19n4pWZry37Fl9pORcQ79l713LdmYvMQMdjNg9NwA3i2+dE+J0EZv34830E 8Jkxehb/7G5qPxcO/JbD8RvFkwdLhAhE1PlMtoRNQIVqyPH/N2BGjMNbamjfv7+AGv0b 45d8aNp5r2B14h4vNXUm9N0EqTNtc0vCV/9ZPQUc7g+a5m8JX16nKaLkDhrkjNS0mlhy lqQqmIycQfhpeL4ew9N+xN4KzExFCE6/k1JewQKyzoL1/mLvSa7riB1OK2E+V6xPwE+U oMPtqR5tFREjYH2Ah8kIBtJJr/z2R6LrFMdk+v83yhDAxtl9yLkq408vDaHkhvBj2wLI JXcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720957395; x=1721562195; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=voezqBRIqgR1xMbzJXPZuwUUHTRBRdZ/+JwyhtZNvfc=; b=pmx/MR9nEV9kT1YlFn57gnOMzP6T3Af7q3/CUa+f5WxS8/ZThkMhsO4JrC6rynFmRA iYe9Lgm96yyU7jVFq8BQE6SipsNo3lSq7WbukSWaIUCoTCGesaQWP6JoCeCgxLfSmAt2 wY8L7sLqp2xjI2B39PW9mIE8MGHqZoVGllfZy+W6ww09yNdR44A33HFv2m0GRF5kDt3Z GGA1vHPFGaMGIHw1L9xZ3BbbnV48XP9vceO9pKEZhw8m+0c0/77XrQbz9akoo/hZyt7+ H1H3ROaMvA0x9ERakyjIqaMTIVBJQupw0JYHC0+rtYmnDFPKdvBxHyMrKkfHPu6VHG8V PTZA== X-Forwarded-Encrypted: i=1; AJvYcCWY3D5+OL8JfRzUanI5rQQiMNYYjDWQ82E6isdqHd19EYtAo55h/inGsbqqcCpixmCbZIEE+ZvXIuhQTd5MzqrlFYibewLBTfsHp+fboosp6RY2two= X-Gm-Message-State: AOJu0Yy4iYfj44Ckbhj09MHMzszGR8UzWkDJFdfBUW05cKXqdeEj0rab YswzI8FxBe1E0TobUgOYtr5On/rKpSn3ZeBLWxm5rQ5CkQxzX5SN X-Google-Smtp-Source: AGHT+IHznxvk3jGNuxACzlPePqJZsFU4Gm7h8xaiwzJni80Kfh+rpr363DBOkzF8Q4inWF6XdCSGjw== X-Received: by 2002:a05:6000:1814:b0:364:d2b6:4520 with SMTP id ffacd0b85a97d-367ce5df304mr10897937f8f.0.1720957394652; Sun, 14 Jul 2024 04:43:14 -0700 (PDT) Received: from localhost ([2001:861:3385:e20:6384:4cf:52c5:3194]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3680db0492asm3624096f8f.103.2024.07.14.04.43.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jul 2024 04:43:14 -0700 (PDT) From: Raphael Gallais-Pou Date: Sun, 14 Jul 2024 13:42:46 +0200 Subject: [PATCH v3 2/2] thermal: sti: depend on THERMAL_OF subsystem MIME-Version: 1.0 Message-Id: <20240714-thermal-v3-2-88f2489ef7d5@gmail.com> References: <20240714-thermal-v3-0-88f2489ef7d5@gmail.com> In-Reply-To: <20240714-thermal-v3-0-88f2489ef7d5@gmail.com> To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Maxime Coquelin , Alexandre Torgue , Patrice Chotard , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org X-Mailer: b4 0.14.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240714_044317_155372_87A7AD4C X-CRM114-Status: GOOD ( 15.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Switch to thermal_of_zone to handle thermal-zones. Replace thermal_zone_device_register() by devm_thermal_of_zone_register() and remove ops st_thermal_get_trip_type, st_thermal_get_trip_temp. Signed-off-by: Raphael Gallais-Pou --- Changes in v3: - Fix unmet dependency when building with ARM64 compiler https://lore.kernel.org/lkml/202406270605.qodaWd4n-lkp@intel.com/ - Remove no more used polling_delay variable detected by kernel robot https://lore.kernel.org/lkml/202406270530.kN5wIswi-lkp@intel.com/ Changes in v2: - Remove unused struct thermal_trip trip --- drivers/thermal/st/Kconfig | 2 ++ drivers/thermal/st/st_thermal.c | 28 ++++++++++------------------ 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/drivers/thermal/st/Kconfig b/drivers/thermal/st/Kconfig index ecbdf4ef00f4..95a634709a99 100644 --- a/drivers/thermal/st/Kconfig +++ b/drivers/thermal/st/Kconfig @@ -5,12 +5,14 @@ config ST_THERMAL tristate "Thermal sensors on STMicroelectronics STi series of SoCs" + depends on THERMAL_OF help Support for thermal sensors on STMicroelectronics STi series of SoCs. config ST_THERMAL_MEMMAP select ST_THERMAL tristate "STi series memory mapped access based thermal sensors" + depends on THERMAL_OF config STM32_THERMAL tristate "Thermal framework support on STMicroelectronics STM32 series of SoCs" diff --git a/drivers/thermal/st/st_thermal.c b/drivers/thermal/st/st_thermal.c index 5f33543a3a54..23597819ce84 100644 --- a/drivers/thermal/st/st_thermal.c +++ b/drivers/thermal/st/st_thermal.c @@ -12,6 +12,7 @@ #include #include "st_thermal.h" +#include "../thermal_hwmon.h" /* The Thermal Framework expects millidegrees */ #define mcelsius(temp) ((temp) * 1000) @@ -135,8 +136,6 @@ static struct thermal_zone_device_ops st_tz_ops = { .get_temp = st_thermal_get_temp, }; -static struct thermal_trip trip; - int st_thermal_register(struct platform_device *pdev, const struct of_device_id *st_thermal_of_match) { @@ -145,7 +144,6 @@ int st_thermal_register(struct platform_device *pdev, struct device_node *np = dev->of_node; const struct of_device_id *match; - int polling_delay; int ret; if (!np) { @@ -197,29 +195,22 @@ int st_thermal_register(struct platform_device *pdev, if (ret) goto sensor_off; - polling_delay = sensor->ops->register_enable_irq ? 0 : 1000; - - trip.temperature = sensor->cdata->crit_temp; - trip.type = THERMAL_TRIP_CRITICAL; - sensor->thermal_dev = - thermal_zone_device_register_with_trips(dev_name(dev), &trip, 1, sensor, - &st_tz_ops, NULL, 0, polling_delay); + devm_thermal_of_zone_register(dev, 0, sensor, &st_tz_ops); if (IS_ERR(sensor->thermal_dev)) { - dev_err(dev, "failed to register thermal zone device\n"); + dev_err(dev, "failed to register thermal of zone\n"); ret = PTR_ERR(sensor->thermal_dev); goto sensor_off; } - ret = thermal_zone_device_enable(sensor->thermal_dev); - if (ret) - goto tzd_unregister; platform_set_drvdata(pdev, sensor); - return 0; + /* + * devm_thermal_of_zone_register() doesn't enable hwmon by default + * Enable it here + */ + return devm_thermal_add_hwmon_sysfs(dev, sensor->thermal_dev); -tzd_unregister: - thermal_zone_device_unregister(sensor->thermal_dev); sensor_off: st_thermal_sensor_off(sensor); @@ -232,7 +223,8 @@ void st_thermal_unregister(struct platform_device *pdev) struct st_thermal_sensor *sensor = platform_get_drvdata(pdev); st_thermal_sensor_off(sensor); - thermal_zone_device_unregister(sensor->thermal_dev); + thermal_remove_hwmon_sysfs(sensor->thermal_dev); + devm_thermal_of_zone_unregister(sensor->dev, sensor->thermal_dev); } EXPORT_SYMBOL_GPL(st_thermal_unregister);