From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Linux PM <linux-pm@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
Zhang Rui <rui.zhang@intel.com>, Amit Kucheria <amitk@kernel.org>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Sebastian Reichel <sre@kernel.org>
Subject: [PATCH v1 2/4] thermal: core: Add function for registering tripless thermal zones
Date: Wed, 30 Aug 2023 18:13:35 +0200 [thread overview]
Message-ID: <3255685.aeNJFYEL58@kreacher> (raw)
In-Reply-To: <1870450.tdWV9SEqCh@kreacher>
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
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 <rafael.j.wysocki@intel.com>
---
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)
{ }
next prev parent reply other threads:[~2023-08-30 18:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-30 16:10 [PATCH v1 0/4] thermal: Eliminate thermal_zone_device_register() Rafael J. Wysocki
2023-08-30 16:11 ` [PATCH v1 1/4] thermal: core: Clean up headers of thermal zone registration functions Rafael J. Wysocki
2023-08-30 16:13 ` Rafael J. Wysocki [this message]
2023-08-30 16:14 ` [PATCH v1 3/4] thermal: Use thermal_tripless_zone_device_register() Rafael J. Wysocki
2023-08-31 6:58 ` Miquel Raynal
2023-09-04 12:54 ` Rafael J. Wysocki
2023-09-04 12:56 ` Rafael J. Wysocki
2023-09-12 16:30 ` Sebastian Reichel
2023-08-30 16:16 ` [PATCH v1 4/4] thermal: core: Drop thermal_zone_device_register() Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3255685.aeNJFYEL58@kreacher \
--to=rjw@rjwysocki.net \
--cc=amitk@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=rui.zhang@intel.com \
--cc=sre@kernel.org \
--cc=srinivas.pandruvada@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).