From patchwork Wed Aug 30 16:13:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 137189 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp4716862vqm; Wed, 30 Aug 2023 11:53:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZHr/rx2B4yBhjXeFzhjnpUU0iJRdqbGSOj9eu8pPTqTeuMqrxS+rctZ2Oz6y1czcM8E1X X-Received: by 2002:a17:902:bd42:b0:1bd:da96:dc70 with SMTP id b2-20020a170902bd4200b001bdda96dc70mr3095765plx.49.1693421630368; Wed, 30 Aug 2023 11:53:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693421630; cv=none; d=google.com; s=arc-20160816; b=giaKYeYr9i9rrgkE6oK/lbR9nZDeD7clQ75szCac71U+QeeUhdnUFQ0ohTHkCALZJE LAcBFkIUWQ1CNNeb87qxvZKiXM16mzutN5YsKcEJbYG5HoHMP0WquFoe2IioTy99GoYy Flp2ASlaJ7bbKT5eXkgg7+/m5WpkcTXg/njeCK8s5EknEw6IFw4t3GYeeD+shacs0MkZ WYc5Fu6I3hYNdRGef2IRu3jcdN+mIrKTumxrgS3ypxmfihZudgCDnsgKb8PGwmD/xvHI umhajyhTdDpV1nY110ngQM1i4qDIrjsqOw90ML50EOsfNpX3hUvWka7Y6fdiI0wrhZzn WiEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=80f6lmyh/X7NYecLk2uGu6Txg/VCaqak0LUIEh7edRc=; fh=ft7C0AkFVXQfLsxS1mqtEwpxNshOt4NdptqXrfNbhrM=; b=SkrecNy1AJ67oBrEW7ThjJ3nYWqKB/IaEnyU8M4j7U83igX6rfQI0QOwGP40n7QE0F jkRXZQrUJz4c7HykfAu9JP1eAK7KMXJ7y1A9ndP+BQ+OYdW6u4DBBg+AEgNtOPiiQoQt +2TfjYbb73zCvb0+H7jJtP35HUheIPizFFBdSJ3so//h1oabeWfLF6IctCTMTEMEzXGP 14DxzKmu7/MGxpUhCAZaLkJjgu3It1C8+CPiO3Tx9IcI11ZUOhbYsMNkcnyrNbCwBW8q y6ZA5va3FVZ+xj/HAa98A/KIMOXqLy37iRqTTXffguO8elQxJ0NFNi9HnEgeEP8ewDZf rTZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k1-20020a170902694100b001b89bcfb2c3si1928090plt.162.2023.08.30.11.53.34; Wed, 30 Aug 2023 11:53:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243409AbjH3SsU (ORCPT + 99 others); Wed, 30 Aug 2023 14:48:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343618AbjH3QRC (ORCPT ); Wed, 30 Aug 2023 12:17:02 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8579E1A3; Wed, 30 Aug 2023 09:16:56 -0700 (PDT) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.2.0) id 8838a3f6621ea0da; Wed, 30 Aug 2023 18:16:55 +0200 Authentication-Results: v370.home.net.pl; spf=softfail (domain owner discourages use of this host) smtp.mailfrom=rjwysocki.net (client-ip=195.136.19.94; helo=[195.136.19.94]; envelope-from=rjw@rjwysocki.net; receiver=) Received: from kreacher.localnet (unknown [195.136.19.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 74E3966316E; Wed, 30 Aug 2023 18:16:54 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Daniel Lezcano , Srinivas Pandruvada , Zhang Rui , Amit Kucheria , Miquel Raynal , Sebastian Reichel Subject: [PATCH v1 2/4] thermal: core: Add function for registering tripless thermal zones Date: Wed, 30 Aug 2023 18:13:35 +0200 Message-ID: <3255685.aeNJFYEL58@kreacher> In-Reply-To: <1870450.tdWV9SEqCh@kreacher> References: <1870450.tdWV9SEqCh@kreacher> MIME-Version: 1.0 X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedviedrudefkedguddtudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpedvffeuiedtgfdvtddugeeujedtffetteegfeekffdvfedttddtuefhgeefvdejhfenucfkphepudelhedrudefiedrudelrdelgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduleehrddufeeirdduledrleegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeekpdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepuggrnhhivghlrdhlvgiitggrnhhosehlihhnrghrohdrohhrghdprhgtphhtthhopehsrhhinhhivhgrshdrphgrnhgurhhuvhgruggrsehlihhnuhigrdhinhht vghlrdgtohhmpdhrtghpthhtoheprhhuihdriihhrghnghesihhnthgvlhdrtghomhdprhgtphhtthhopegrmhhithhksehkvghrnhgvlhdrohhrgh X-DCC--Metrics: v370.home.net.pl 1024; Body=8 Fuz1=8 Fuz2=8 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1775681279113687097 X-GMAIL-MSGID: 1775681279113687097 From: Rafael J. Wysocki Multiple callers of thermal_zone_device_register() don't pass any trips to it and they might use a shortened argument list for that, so add a special function with fewer arguments for this purpose. Signed-off-by: Rafael J. Wysocki --- drivers/thermal/thermal_core.c | 11 +++++++++++ include/linux/thermal.h | 13 +++++++++++++ 2 files changed, 24 insertions(+) Index: linux-pm/drivers/thermal/thermal_core.c =================================================================== --- linux-pm.orig/drivers/thermal/thermal_core.c +++ linux-pm/drivers/thermal/thermal_core.c @@ -1400,6 +1400,17 @@ struct thermal_zone_device *thermal_zone } EXPORT_SYMBOL_GPL(thermal_zone_device_register); +struct thermal_zone_device *thermal_tripless_zone_device_register( + const char *type, + void *devdata, + struct thermal_zone_device_ops *ops, + const struct thermal_zone_params *tzp) +{ + return thermal_zone_device_register_with_trips(type, NULL, 0, 0, devdata, + ops, tzp, 0, 0); +} +EXPORT_SYMBOL_GPL(thermal_tripless_zone_device_register); + void *thermal_zone_device_priv(struct thermal_zone_device *tzd) { return tzd->devdata; Index: linux-pm/include/linux/thermal.h =================================================================== --- linux-pm.orig/include/linux/thermal.h +++ linux-pm/include/linux/thermal.h @@ -317,6 +317,12 @@ struct thermal_zone_device *thermal_zone const struct thermal_zone_params *tzp, int passive_delay, int polling_delay); +struct thermal_zone_device *thermal_tripless_zone_device_register( + const char *type, + void *devdata, + struct thermal_zone_device_ops *ops, + const struct thermal_zone_params *tzp); + void thermal_zone_device_unregister(struct thermal_zone_device *tz); void *thermal_zone_device_priv(struct thermal_zone_device *tzd); @@ -377,6 +383,13 @@ static inline struct thermal_zone_device int passive_delay, int polling_delay); { return ERR_PTR(-ENODEV); } +static inline struct thermal_zone_device *thermal_tripless_zone_device_register( + const char *type, + void *devdata, + struct thermal_zone_device_ops *ops, + const struct thermal_zone_params *tzp) +{ return ERR_PTR(-ENODEV); } + static inline void thermal_zone_device_unregister(struct thermal_zone_device *tz) { } From patchwork Wed Aug 30 16:14:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 137179 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp4713530vqm; Wed, 30 Aug 2023 11:46:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGffcruVRnOnPdXitDoe82aTppN+noTUiY2CwQB3Eh7lX1sIwZqWwrAs8b2K3fhVezgbzx5 X-Received: by 2002:a05:6300:808b:b0:14d:4126:b293 with SMTP id ap11-20020a056300808b00b0014d4126b293mr2696290pzc.56.1693421165536; Wed, 30 Aug 2023 11:46:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693421165; cv=none; d=google.com; s=arc-20160816; b=Pzcvb8D6Gip5KYStzXQVDnB+wWkE1URP4mSZW2PQRmgT6ASNaMrSS58uyoYIvJDkSh OPhlOT5lSLTNuToyOmYPh7xFBV7ClQU555euTyHWVUO1l9LeJNeB1WY5ti0dEmWn2RYN rFRC1e6c0PSuZPh5n8gMEw9BgHfNOwPHC0E8r+nGMedKxFB1MhObBBirX3Qfyi0ChYt/ QFpjWdzWXL84vVBcfu2TkYNhbaWIJl9Bhpj3JRfwnFV+xx3qg2ORmT7IUwOpCCT2mRkh JmcXMJrr2O/GwcYaKbEdg0V/0p6ZCndx75Aqb3HkeLM3XuJRG6inPUYrNDL6vFt8uJy6 DcKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=yO1auKSJS6zoEW1mjk8cbx6qJno4bNJEHNbWIt7SOcM=; fh=ft7C0AkFVXQfLsxS1mqtEwpxNshOt4NdptqXrfNbhrM=; b=kFNwaPHHlaeGwHvnmU0pTV66fxYC3nOAEYpIJu2pWTim9O0dQHzahNr2a1KkzeqZOz E5o1vSKIRZ/14cGU2hK0MnfWpV1u3XF8wcpdfgfnIdc8XfIV+pbhA5OnahjJ9FV6veIf NA0RdlVE/1R2sTE7OPNjurGKu8bGPmboDohsszT4PEh3Zuw0mZ4HY0eDURtgIbitigh0 IprlFfOLIAQ032FW8b/J26iaeYWeTcExLeF8bpeUlW+Gd4u5cXxudI0Cd9ZIzpyHIszj h6jamNClefiIo6NKPKF54wdiZ+h5ZzhlwzkzPQlK69YoqtRb7yRHArcYxs3m2uaYkbN5 fqqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n8-20020aa78a48000000b0068a590d803csi11888809pfa.361.2023.08.30.11.45.50; Wed, 30 Aug 2023 11:46:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236718AbjH3Scm (ORCPT + 99 others); Wed, 30 Aug 2023 14:32:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343616AbjH3QRB (ORCPT ); Wed, 30 Aug 2023 12:17:01 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF0CD1A1; Wed, 30 Aug 2023 09:16:55 -0700 (PDT) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.2.0) id 09f20c2cacebe463; Wed, 30 Aug 2023 18:16:54 +0200 Authentication-Results: v370.home.net.pl; spf=softfail (domain owner discourages use of this host) smtp.mailfrom=rjwysocki.net (client-ip=195.136.19.94; helo=[195.136.19.94]; envelope-from=rjw@rjwysocki.net; receiver=) Received: from kreacher.localnet (unknown [195.136.19.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id A93FA66316E; Wed, 30 Aug 2023 18:16:53 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Daniel Lezcano , Srinivas Pandruvada , Zhang Rui , Amit Kucheria , Miquel Raynal , Sebastian Reichel Subject: [PATCH v1 3/4] thermal: Use thermal_tripless_zone_device_register() Date: Wed, 30 Aug 2023 18:14:57 +0200 Message-ID: <8272147.T7Z3S40VBb@kreacher> In-Reply-To: <1870450.tdWV9SEqCh@kreacher> References: <1870450.tdWV9SEqCh@kreacher> MIME-Version: 1.0 X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedviedrudefkedguddtudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpedvffeuiedtgfdvtddugeeujedtffetteegfeekffdvfedttddtuefhgeefvdejhfenucfkphepudelhedrudefiedrudelrdelgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduleehrddufeeirdduledrleegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeekpdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepuggrnhhivghlrdhlvgiitggrnhhosehlihhnrghrohdrohhrghdprhgtphhtthhopehsrhhinhhivhgrshdrphgrnhgurhhuvhgruggrsehlihhnuhigrdhinhht vghlrdgtohhmpdhrtghpthhtoheprhhuihdriihhrghnghesihhnthgvlhdrtghomhdprhgtphhtthhopegrmhhithhksehkvghrnhgvlhdrohhrgh X-DCC--Metrics: v370.home.net.pl 1024; Body=8 Fuz1=8 Fuz2=8 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1775680791718837951 X-GMAIL-MSGID: 1775680791718837951 From: Rafael J. Wysocki All of the remaining callers of thermal_zone_device_register() can use thermal_tripless_zone_device_register(), so make them do so in order to allow the former to be dropped. No intentional functional impact. Signed-off-by: Rafael J. Wysocki Acked-by: Sebastian Reichel --- drivers/power/supply/power_supply_core.c | 4 ++-- drivers/thermal/armada_thermal.c | 5 +++-- drivers/thermal/dove_thermal.c | 4 ++-- drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 6 +++--- drivers/thermal/kirkwood_thermal.c | 4 ++-- drivers/thermal/spear_thermal.c | 4 ++-- 6 files changed, 14 insertions(+), 13 deletions(-) Index: linux-pm/drivers/power/supply/power_supply_core.c =================================================================== --- linux-pm.orig/drivers/power/supply/power_supply_core.c +++ linux-pm/drivers/power/supply/power_supply_core.c @@ -1305,8 +1305,8 @@ static int psy_register_thermal(struct p /* Register battery zone device psy reports temperature */ if (psy_has_property(psy->desc, POWER_SUPPLY_PROP_TEMP)) { - psy->tzd = thermal_zone_device_register(psy->desc->name, - 0, 0, psy, &psy_tzd_ops, NULL, 0, 0); + psy->tzd = thermal_tripless_zone_device_register(psy->desc->name, + psy, &psy_tzd_ops, NULL); if (IS_ERR(psy->tzd)) return PTR_ERR(psy->tzd); ret = thermal_zone_device_enable(psy->tzd); Index: linux-pm/drivers/thermal/armada_thermal.c =================================================================== --- linux-pm.orig/drivers/thermal/armada_thermal.c +++ linux-pm/drivers/thermal/armada_thermal.c @@ -876,8 +876,9 @@ static int armada_thermal_probe(struct p /* Wait the sensors to be valid */ armada_wait_sensor_validity(priv); - tz = thermal_zone_device_register(priv->zone_name, 0, 0, priv, - &legacy_ops, NULL, 0, 0); + tz = thermal_tripless_zone_device_register(priv->zone_name, + priv, &legacy_ops, + NULL); if (IS_ERR(tz)) { dev_err(&pdev->dev, "Failed to register thermal zone device\n"); Index: linux-pm/drivers/thermal/dove_thermal.c =================================================================== --- linux-pm.orig/drivers/thermal/dove_thermal.c +++ linux-pm/drivers/thermal/dove_thermal.c @@ -139,8 +139,8 @@ static int dove_thermal_probe(struct pla return ret; } - thermal = thermal_zone_device_register("dove_thermal", 0, 0, - priv, &ops, NULL, 0, 0); + thermal = thermal_tripless_zone_device_register("dove_thermal", priv, + &ops, NULL); if (IS_ERR(thermal)) { dev_err(&pdev->dev, "Failed to register thermal zone device\n"); Index: linux-pm/drivers/thermal/intel/int340x_thermal/int3400_thermal.c =================================================================== --- linux-pm.orig/drivers/thermal/intel/int340x_thermal/int3400_thermal.c +++ linux-pm/drivers/thermal/intel/int340x_thermal/int3400_thermal.c @@ -609,9 +609,9 @@ static int int3400_thermal_probe(struct evaluate_odvp(priv); - priv->thermal = thermal_zone_device_register("INT3400 Thermal", 0, 0, - priv, &int3400_thermal_ops, - &int3400_thermal_params, 0, 0); + priv->thermal = thermal_tripless_zone_device_register("INT3400 Thermal", priv, + &int3400_thermal_ops, + &int3400_thermal_params); if (IS_ERR(priv->thermal)) { result = PTR_ERR(priv->thermal); goto free_art_trt; Index: linux-pm/drivers/thermal/kirkwood_thermal.c =================================================================== --- linux-pm.orig/drivers/thermal/kirkwood_thermal.c +++ linux-pm/drivers/thermal/kirkwood_thermal.c @@ -71,8 +71,8 @@ static int kirkwood_thermal_probe(struct if (IS_ERR(priv->sensor)) return PTR_ERR(priv->sensor); - thermal = thermal_zone_device_register("kirkwood_thermal", 0, 0, - priv, &ops, NULL, 0, 0); + thermal = thermal_tripless_zone_device_register("kirkwood_thermal", + priv, &ops, NULL); if (IS_ERR(thermal)) { dev_err(&pdev->dev, "Failed to register thermal zone device\n"); Index: linux-pm/drivers/thermal/spear_thermal.c =================================================================== --- linux-pm.orig/drivers/thermal/spear_thermal.c +++ linux-pm/drivers/thermal/spear_thermal.c @@ -122,8 +122,8 @@ static int spear_thermal_probe(struct pl stdev->flags = val; writel_relaxed(stdev->flags, stdev->thermal_base); - spear_thermal = thermal_zone_device_register("spear_thermal", 0, 0, - stdev, &ops, NULL, 0, 0); + spear_thermal = thermal_tripless_zone_device_register("spear_thermal", + stdev, &ops, NULL); if (IS_ERR(spear_thermal)) { dev_err(&pdev->dev, "thermal zone device is NULL\n"); ret = PTR_ERR(spear_thermal); From patchwork Wed Aug 30 16:16:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 137202 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a7d1:0:b0:3f2:4152:657d with SMTP id p17csp4730118vqm; Wed, 30 Aug 2023 12:19:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH03rhJb9Gln+rVBMTmr1+qLPJXsJWY5wxB2fPsE7nk1bOjm1E/LkENicfFkRZ5rNHMrany X-Received: by 2002:a2e:8e26:0:b0:2bc:d5c3:e86e with SMTP id r6-20020a2e8e26000000b002bcd5c3e86emr2124940ljk.4.1693423056799; Wed, 30 Aug 2023 12:17:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693423056; cv=none; d=google.com; s=arc-20160816; b=RYLWMdO8UxXQ8alpuytsPT+Zi/SOzcNIAyu2BRpDMeIO9KLSADrZlnuiJNzA1+Jr9F HkLao74EbSopbzYnEBqGE8CriN9InGCNQB5ncR0ZrXQZjJ6hS1+HgdGtuSvNpT0/DEqw 6B0bfDEmebNWoGU/1kfCyBA3cPIZIsNYn05LSn5KJd5NSfvhsm3IrMmXE+ki3bqsDco5 R9bx/hqngTeutmQ2nwTGrakmyAduKxO+fOCpFkI9JO+PX7gWzDsHNOf4yeerUPodiVH/ zyNDjJmENajBvDuQnEpOmjNGXTRFtGGbN9RY2E6uqRYmKy3UY1W8bEmQla63REXF424n EbLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=i4p4NuqMpxiCzBxXToJkZBA4hRq0NkW+dOk8zpqRyHY=; fh=ft7C0AkFVXQfLsxS1mqtEwpxNshOt4NdptqXrfNbhrM=; b=THRBxwnz8YMQLnVsq/euaKhO12MzCRZaKQTzhXoO04lviBDlWSbmeSegT52rEcTddz CqUwoS2uaLr2/UN6yzilsnwdI++pwLBUJVtwcz1PcG6Bi7ybH2dXjIRHhXkmkFu37q1H VjqOBu1HoK+fOoWkGxWg3RDVADdvkeMXyUCrH+Kg11PDZnirWsQ8Zoi5MaynmPjKgmlG uz2fiNHubv49eUa+XnvAeU8xF5b4gLv9J74PBYTSdAElMY9MW4GshEvqeQ4/pWOxLh5p jf4wezmmfaKg0kdfaYvr1qzJdhjRlMoewCYvYJgqk3OFFyxpGx5vDxQLTWLTylXpDYxg xnxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ss22-20020a170907c01600b009a5e55d5824si1154495ejc.145.2023.08.30.12.17.11; Wed, 30 Aug 2023 12:17:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234120AbjH3TIl (ORCPT + 99 others); Wed, 30 Aug 2023 15:08:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343615AbjH3QRB (ORCPT ); Wed, 30 Aug 2023 12:17:01 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12F62A6; Wed, 30 Aug 2023 09:16:54 -0700 (PDT) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.2.0) id 4cc119add8adde6f; Wed, 30 Aug 2023 18:16:53 +0200 Authentication-Results: v370.home.net.pl; spf=softfail (domain owner discourages use of this host) smtp.mailfrom=rjwysocki.net (client-ip=195.136.19.94; helo=[195.136.19.94]; envelope-from=rjw@rjwysocki.net; receiver=) Received: from kreacher.localnet (unknown [195.136.19.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id CE60766316E; Wed, 30 Aug 2023 18:16:52 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Daniel Lezcano , Srinivas Pandruvada , Zhang Rui , Amit Kucheria , Miquel Raynal , Sebastian Reichel Subject: [PATCH v1 4/4] thermal: core: Drop thermal_zone_device_register() Date: Wed, 30 Aug 2023 18:16:29 +0200 Message-ID: <2245654.iZASKD2KPV@kreacher> In-Reply-To: <1870450.tdWV9SEqCh@kreacher> References: <1870450.tdWV9SEqCh@kreacher> MIME-Version: 1.0 X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedviedrudefkedguddtudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkjghfggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpedvffeuiedtgfdvtddugeeujedtffetteegfeekffdvfedttddtuefhgeefvdejhfenucfkphepudelhedrudefiedrudelrdelgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduleehrddufeeirdduledrleegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeekpdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepuggrnhhivghlrdhlvgiitggrnhhosehlihhnrghrohdrohhrghdprhgtphhtthhopehsrhhinhhivhgrshdrphgrnhgurhhuvhgruggrsehlihhnuhigrdhinhht vghlrdgtohhmpdhrtghpthhtoheprhhuihdriihhrghnghesihhnthgvlhdrtghomhdprhgtphhtthhopegrmhhithhksehkvghrnhgvlhdrohhrgh X-DCC--Metrics: v370.home.net.pl 1024; Body=8 Fuz1=8 Fuz2=8 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1775682775248109960 X-GMAIL-MSGID: 1775682775248109960 From: Rafael J. Wysocki There are no more users of thermal_zone_device_register(), so drop it from the core. Note that thermal_zone_device_register_with_trips() may be renamed to thermal_zone_device_register() in the future, but only after a grace period allowing all of the possible work in progress that may be using the latter to adjust. Signed-off-by: Rafael J. Wysocki --- drivers/thermal/thermal_core.c | 11 ----------- include/linux/thermal.h | 17 ----------------- 2 files changed, 28 deletions(-) Index: linux-pm/drivers/thermal/thermal_core.c =================================================================== --- linux-pm.orig/drivers/thermal/thermal_core.c +++ linux-pm/drivers/thermal/thermal_core.c @@ -1389,17 +1389,6 @@ free_tz: } EXPORT_SYMBOL_GPL(thermal_zone_device_register_with_trips); -struct thermal_zone_device *thermal_zone_device_register(const char *type, int ntrips, int mask, - void *devdata, struct thermal_zone_device_ops *ops, - const struct thermal_zone_params *tzp, int passive_delay, - int polling_delay) -{ - return thermal_zone_device_register_with_trips(type, NULL, ntrips, mask, - devdata, ops, tzp, - passive_delay, polling_delay); -} -EXPORT_SYMBOL_GPL(thermal_zone_device_register); - struct thermal_zone_device *thermal_tripless_zone_device_register( const char *type, void *devdata, Index: linux-pm/include/linux/thermal.h =================================================================== --- linux-pm.orig/include/linux/thermal.h +++ linux-pm/include/linux/thermal.h @@ -300,14 +300,6 @@ int thermal_acpi_critical_trip_temp(stru #endif #ifdef CONFIG_THERMAL -struct thermal_zone_device *thermal_zone_device_register( - const char *type, - int num_trips, int mask, - void *devdata, - struct thermal_zone_device_ops *ops, - const struct thermal_zone_params *tzp, - int passive_delay, int polling_delay); - struct thermal_zone_device *thermal_zone_device_register_with_trips( const char *type, struct thermal_trip *trips, @@ -364,15 +356,6 @@ int thermal_zone_device_enable(struct th int thermal_zone_device_disable(struct thermal_zone_device *tz); void thermal_zone_device_critical(struct thermal_zone_device *tz); #else -static inline struct thermal_zone_device *thermal_zone_device_register( - const char *type, - int num_trips, int mask, - void *devdata, - struct thermal_zone_device_ops *ops, - const struct thermal_zone_params *tzp, - int passive_delay, int polling_delay) -{ return ERR_PTR(-ENODEV); } - static inline struct thermal_zone_device *thermal_zone_device_register_with_trips( const char *type, struct thermal_trip *trips,