From patchwork Tue Jul 16 17:34:51 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: 13734713 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 5A11CC3DA49 for ; Tue, 16 Jul 2024 17:36:08 +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=bAQWEK46ZWZIRZK4a1Nbp7rquUK8x0wTaH1JyzdX3Kg=; b=UtfvBiQCE4T+MwlFY1nTlbEV5X /dogMtklA3baXtoj8L0zcAocfxJp/tp/nQe2rwuEgZx1grDjHEVDsuTO+pGWmp1yYPQ5eVvw0pc+r toBo0AYGIqGBMCPF+7ZEx0C81cq3A5+Kr4ERZ1JWTGghkGZpYWdGLhVcsfKFcMlP+h6oIsM1JnImD AUohJ1k+Vijv8tzhKvT4pyCPiGMCqWS1xjFnrvqd/cqGULWQEGF4ruyw2LG/EUCf/3z2D454fmUvq 1mpRr8CRS5gGaiDLbE5bZ2S0CE6bYaltUqE7YNFtZPgfRK6ydNcwHLC5ubQ4L9AepGqqfBINszpJk w+qZBsHw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sTm5g-0000000B9r3-2qR2; Tue, 16 Jul 2024 17:35:53 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sTm55-0000000B9fi-0O1T for linux-arm-kernel@lists.infradead.org; Tue, 16 Jul 2024 17:35:16 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4266fd395eeso40588875e9.3 for ; Tue, 16 Jul 2024 10:35:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721151313; x=1721756113; 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=bAQWEK46ZWZIRZK4a1Nbp7rquUK8x0wTaH1JyzdX3Kg=; b=SLYWqB3A/adwHV303qkPHi+FC5cubFLDN3Ydx+FqK/gBnR81RJoDu0k9pbCDk8W4+F Ebn3Wz+VVgsDErpwurLyJMOl3JGqOUH9oKAycpovAB5kZ+UuWoTaT01ZlQ/Fk58tZ+nL 0/SDgkeOXdx7cdvxRPnr93SpqC2Dcjslb/dGuStS+IyVD3RgAnojwV6R0iKRMuC8zjYW xa5cY0SfEED0xrJOZOQ7Cwseqduagy2koAYgILDeBi0jKso3Ed+b98bGDEsyvxIxNt6I ftUwGnOW7NtTuzCGeRJziFctXmUAEbNVsexL2hegH0dV9hagphL16tNyHUNU0n6QZaYM jYmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721151313; x=1721756113; 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=bAQWEK46ZWZIRZK4a1Nbp7rquUK8x0wTaH1JyzdX3Kg=; b=ucsWMEm/Itq7O87vD+kyugKUE0xDSMeDPH1CHo/qp5uTNJMH1vPoFSyc5281hXfBGE JCwf9Gju4NUCpRGliaVma3ye4F9bsPWPu8d9f/Dj/X05Dj0t5lcB0nAI8SKkCduO1r7I 2oPBL7HsbhhycYhYKQxzS126IBiAyca6wOkUa1AGJstg3J2cp4vSMWUCSYbYx6V9OurA KyXnrVMCprH60MXXVPPUn+4qMyPjH9idFR4ytGKAnwgFaToZMfF0tWLggcqaYvIEjsz1 amalvCmI+Yd7tQ7Q+nistFRHv3bi5xbzYTc3ZKo9qIFRfv/A+Y3t8ZJh3hLlFtE6CE6Q qH/Q== X-Forwarded-Encrypted: i=1; AJvYcCVflJxaTKplZXoOXSiFZwtTr+A9q4RjuLybj4uuxEnxgJ4nh08mTdrn3KsX6FuAcUZLUJ8ddGwI2MXBnme7WqApDHUD3hyJae0CFUdbcrzg2FUKI9E= X-Gm-Message-State: AOJu0YzPvfyWCUq+xrSvMOcVXwrrOakSej4IjBXYfBOZcpH7Z+x/qvXV 1luXFm8koUERnnMC0MMdNwgZXt/620YZrm2aHjhOXDYi7/l/cVA24Y+8/w== X-Google-Smtp-Source: AGHT+IFsEJAoNxLYSE5KxDRk11nslRcJ+xQxLGcEtecc0HTGqboFocwxBD4yicc4yd2u8CqRnVX0ig== X-Received: by 2002:a05:6000:2c1:b0:367:9ab5:2c80 with SMTP id ffacd0b85a97d-3682635d007mr1853778f8f.57.1721151312578; Tue, 16 Jul 2024 10:35:12 -0700 (PDT) Received: from localhost ([2001:861:3385:e20:6384:4cf:52c5:3194]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3680db04841sm9612414f8f.101.2024.07.16.10.35.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 10:35:12 -0700 (PDT) From: Raphael Gallais-Pou Date: Tue, 16 Jul 2024 19:34:51 +0200 Subject: [PATCH v4 1/2] thermal: st: switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() MIME-Version: 1.0 Message-Id: <20240716-thermal-v4-1-947b327e165c@gmail.com> References: <20240716-thermal-v4-0-947b327e165c@gmail.com> In-Reply-To: <20240716-thermal-v4-0-947b327e165c@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-20240716_103515_172339_59B0E203 X-CRM114-Status: GOOD ( 15.28 ) 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 e427117381a4..97493d2b2f49 100644 --- a/drivers/thermal/st/st_thermal_memmap.c +++ b/drivers/thermal/st/st_thermal_memmap.c @@ -170,7 +170,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 Tue Jul 16 17:34:52 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: 13734714 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 7E665C3DA59 for ; Tue, 16 Jul 2024 17:36:23 +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=mFZzo+h40ZkOiMih2IEE7mwoxCHvaz4i8bbYlqWEClA=; b=gujsWmwW5+sofwicUBM0xwCN29 GEeJCQ1iwGn/bWPr7agunKC6W6RLZK5Hb5XFVLf5kTRcx4+hoDfnrwkjiNPGF0EXi5noDHKnPTJqf 8JwUORPgySc5cNX1PCSS0YWqK5gH0nw5L3ux5cqI3x3lq9dt/lqm/z0roEUzhDclGTpNZxLTDAUIe k0C4JfkHpUqEgnzbZLiPplS97Dp5hDfLfr35fg3hN+hd2dfLsLjs+celURZWiuUOUFKPYj6GUJoGn kF6naEPUPPWwImyTOQAz+Pg9D7/qBiSUQzu2vHRvuaBjxKFKtqOHCoLjcD7XO0TBTSJp9nHhJwBYc YfYZ8w8w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sTm5y-0000000B9xb-3QiN; Tue, 16 Jul 2024 17:36:10 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sTm55-0000000B9fm-3B32 for linux-arm-kernel@lists.infradead.org; Tue, 16 Jul 2024 17:35:17 +0000 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-367ab50a07aso3660978f8f.0 for ; Tue, 16 Jul 2024 10:35:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721151314; x=1721756114; 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=mFZzo+h40ZkOiMih2IEE7mwoxCHvaz4i8bbYlqWEClA=; b=I7J53Fxcp1JhsLLMlXbzvleWVp/Lbh3huhhMU4luVEaa3wnQwZMZCk51+tXN2R/Rtm m/3AJtxJUhB3VX0gtniICiUvQ5ZOKPhqH8T1R1NtiJcHPyM31riqAh7BkHztVwAWKkOS FBPlNU1Cxgg5U21zSHgTS/K3WlHHANXl0zkb2AWBHkttWcYJ0rY0AmxIX4+ZC12aHlr6 ohNrq30qImTXy8bUCW8srLFd2cbexhbfjWitc0int5pRYCo3EBPBSp16z+9FbjhnsNKC IBT2NnTdsXfO2fOQVPif48tf6g5kVxRdJwB1Ae+9VvCFfkDj/cu71mSa+kd/fsDG3JJI 0YDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721151314; x=1721756114; 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=mFZzo+h40ZkOiMih2IEE7mwoxCHvaz4i8bbYlqWEClA=; b=ZzEomxQqHCZQD6NI4Nhz6+GVEi98IQZll+Xc0sGw6zuTTEtz532oO6QuCbLwXmzi3r 9LbR5cKr3TGstRFtpWO1gxxxHisiKRSh5ISIve0433GiDhclHH2g5xKom/b3ZwGLFfKC GRRw1AxNrTQ3fVaeZQvqJiGazo8z029+rqFti/IRAz68xcZuP6d8MhB+VHE9NbSnIqsB xrz2+m/cxfRLCEBoCXLz+XRjMSLET/z8/tUD5V0wfjeKwE7Upj17+pboIDxzo+UEIwlc 69qawqDhsPFRcNGKaOZG8iuKO+p2ska3qKOkF4eOn+75nvrKAUhAlxaYSIGnBFxPCVoe ZOGQ== X-Forwarded-Encrypted: i=1; AJvYcCXz+W8owBstZkdzTR3yiCZ/6G378rA5ZaeHfUp7F2ZhOXQkzgJlULz7ortYApn33WCRZsc3yVA2+RhyO8NzTPIjNLjd6jlm2euxRfUX2/k3YBP6kPY= X-Gm-Message-State: AOJu0YwcHUqtp3D2adgkSrBWBrzshCTnxBSKQN7K0LmekSK9EJGgRedB ZMeM5lWrzNuU5cOiX1aY3uLrYYL/ToriIpo0uC8auRLhRKcWaPlJFnYzXA== X-Google-Smtp-Source: AGHT+IE70zhsNBUYOAewbvXHcYgepuMa8i+6KzIjuE7KgPVIgmBQVK7/cIQLRs1F0enKt0xhxVITpg== X-Received: by 2002:a5d:588d:0:b0:367:958e:9822 with SMTP id ffacd0b85a97d-36825f715c0mr2543892f8f.14.1721151313262; Tue, 16 Jul 2024 10:35:13 -0700 (PDT) Received: from localhost ([2001:861:3385:e20:6384:4cf:52c5:3194]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4279f27877dsm167381895e9.26.2024.07.16.10.35.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 10:35:13 -0700 (PDT) From: Raphael Gallais-Pou Date: Tue, 16 Jul 2024 19:34:52 +0200 Subject: [PATCH v4 2/2] thermal: sti: depend on THERMAL_OF subsystem MIME-Version: 1.0 Message-Id: <20240716-thermal-v4-2-947b327e165c@gmail.com> References: <20240716-thermal-v4-0-947b327e165c@gmail.com> In-Reply-To: <20240716-thermal-v4-0-947b327e165c@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-20240716_103515_833193_C05DC6DA X-CRM114-Status: GOOD ( 15.77 ) 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 v4: - Optimize dependencies - Do not return devm_* exit code 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/Kconfig | 2 +- drivers/thermal/st/st_thermal.c | 28 +++++++++++----------------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index ed16897584b4..b6b916e7e294 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig @@ -429,7 +429,7 @@ source "drivers/thermal/samsung/Kconfig" endmenu menu "STMicroelectronics thermal drivers" -depends on (ARCH_STI || ARCH_STM32) && OF +depends on (ARCH_STI || ARCH_STM32) && THERMAL_OF source "drivers/thermal/st/Kconfig" endmenu diff --git a/drivers/thermal/st/st_thermal.c b/drivers/thermal/st/st_thermal.c index 5f33543a3a54..a14a37d54698 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,24 @@ 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); + /* + * devm_thermal_of_zone_register() doesn't enable hwmon by default + * Enable it here + */ + devm_thermal_add_hwmon_sysfs(dev, sensor->thermal_dev); + return 0; -tzd_unregister: - thermal_zone_device_unregister(sensor->thermal_dev); sensor_off: st_thermal_sensor_off(sensor); @@ -232,7 +225,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);