* [PATCH v1 0/4] thermal: Eliminate thermal_zone_device_register()
@ 2023-08-30 16:10 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
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Rafael J. Wysocki @ 2023-08-30 16:10 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Daniel Lezcano, Srinivas Pandruvada, Zhang Rui,
Amit Kucheria, Miquel Raynal, Sebastian Reichel
Hi Everyone,
After recently merged changes in the ACPI thermal and Intel DTS IOSF thermal
drivers, the only callers of thermal_zone_device_register() are the ones
using it for registering thermal zones without any trip points. They all
pass zeros as 4 (out of 8) function arguments, so retaining the full
thermal_zone_device_register() just for this purpose seems a bit excessive.
For this reason, the series adds a thermal_zone_device_register()
replacement tailored to this specific use case and called
thermal_tripless_zone_device_register() [2/4] and makes all of the
existing callers of the former use the replacement [3/4]. This allows
thermal_zone_device_register() to be dropped [4/4].
The first patch is just a clean up making function headers in thermal.h
a bit more consistent.
This series it not intended to make any functional impact, but if the
changes are fine with everyone, I would like to introduce them during the
ongoing merge window to prevent the obsolete interface from lingering.
The series applies to the linux-next branch in linux-pm.git.
Thanks!
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v1 1/4] thermal: core: Clean up headers of thermal zone registration functions
2023-08-30 16:10 [PATCH v1 0/4] thermal: Eliminate thermal_zone_device_register() Rafael J. Wysocki
@ 2023-08-30 16:11 ` Rafael J. Wysocki
2023-08-30 16:13 ` [PATCH v1 2/4] thermal: core: Add function for registering tripless thermal zones Rafael J. Wysocki
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Rafael J. Wysocki @ 2023-08-30 16:11 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Daniel Lezcano, Srinivas Pandruvada, Zhang Rui,
Amit Kucheria, Miquel Raynal, Sebastian Reichel
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
For consistency, add a missing thermal_zone_device_register_with_trips()
stub for the CONFIG_THERMAL unset case, specify argument names in all of
the thermal zone registration and unregistration function headers and
make all of them use white space consistently.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
include/linux/thermal.h | 53 +++++++++++++++++++++++++++++++++---------------
1 file changed, 37 insertions(+), 16 deletions(-)
Index: linux-pm/include/linux/thermal.h
===================================================================
--- linux-pm.orig/include/linux/thermal.h
+++ linux-pm/include/linux/thermal.h
@@ -300,16 +300,24 @@ int thermal_acpi_critical_trip_temp(stru
#endif
#ifdef CONFIG_THERMAL
-struct thermal_zone_device *thermal_zone_device_register(const char *, int, int,
- void *, struct thermal_zone_device_ops *,
- const struct thermal_zone_params *, int, int);
-
-void thermal_zone_device_unregister(struct thermal_zone_device *);
-
-struct thermal_zone_device *
-thermal_zone_device_register_with_trips(const char *, struct thermal_trip *, int, int,
- void *, struct thermal_zone_device_ops *,
- const struct thermal_zone_params *, int, int);
+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,
+ 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);
+
+void thermal_zone_device_unregister(struct thermal_zone_device *tz);
void *thermal_zone_device_priv(struct thermal_zone_device *tzd);
const char *thermal_zone_device_type(struct thermal_zone_device *tzd);
@@ -351,14 +359,27 @@ int thermal_zone_device_disable(struct t
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 trips, int mask, void *devdata,
- struct thermal_zone_device_ops *ops,
- const struct thermal_zone_params *tzp,
- int passive_delay, int polling_delay)
+ 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,
+ 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 void thermal_zone_device_unregister(
- struct thermal_zone_device *tz)
+
+static inline void thermal_zone_device_unregister(struct thermal_zone_device *tz)
{ }
+
static inline struct thermal_cooling_device *
thermal_cooling_device_register(const char *type, void *devdata,
const struct thermal_cooling_device_ops *ops)
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v1 2/4] thermal: core: Add function for registering tripless thermal zones
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
2023-08-30 16:14 ` [PATCH v1 3/4] thermal: Use thermal_tripless_zone_device_register() Rafael J. Wysocki
2023-08-30 16:16 ` [PATCH v1 4/4] thermal: core: Drop thermal_zone_device_register() Rafael J. Wysocki
3 siblings, 0 replies; 9+ messages in thread
From: Rafael J. Wysocki @ 2023-08-30 16:13 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Daniel Lezcano, Srinivas Pandruvada, Zhang Rui,
Amit Kucheria, Miquel Raynal, Sebastian Reichel
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)
{ }
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v1 3/4] thermal: Use thermal_tripless_zone_device_register()
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 ` [PATCH v1 2/4] thermal: core: Add function for registering tripless thermal zones Rafael J. Wysocki
@ 2023-08-30 16:14 ` Rafael J. Wysocki
2023-08-31 6:58 ` Miquel Raynal
` (2 more replies)
2023-08-30 16:16 ` [PATCH v1 4/4] thermal: core: Drop thermal_zone_device_register() Rafael J. Wysocki
3 siblings, 3 replies; 9+ messages in thread
From: Rafael J. Wysocki @ 2023-08-30 16:14 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Daniel Lezcano, Srinivas Pandruvada, Zhang Rui,
Amit Kucheria, Miquel Raynal, Sebastian Reichel
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
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 <rafael.j.wysocki@intel.com>
---
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);
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v1 4/4] thermal: core: Drop thermal_zone_device_register()
2023-08-30 16:10 [PATCH v1 0/4] thermal: Eliminate thermal_zone_device_register() Rafael J. Wysocki
` (2 preceding siblings ...)
2023-08-30 16:14 ` [PATCH v1 3/4] thermal: Use thermal_tripless_zone_device_register() Rafael J. Wysocki
@ 2023-08-30 16:16 ` Rafael J. Wysocki
3 siblings, 0 replies; 9+ messages in thread
From: Rafael J. Wysocki @ 2023-08-30 16:16 UTC (permalink / raw)
To: Linux PM
Cc: LKML, Daniel Lezcano, Srinivas Pandruvada, Zhang Rui,
Amit Kucheria, Miquel Raynal, Sebastian Reichel
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
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 <rafael.j.wysocki@intel.com>
---
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,
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v1 3/4] thermal: Use thermal_tripless_zone_device_register()
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
2 siblings, 1 reply; 9+ messages in thread
From: Miquel Raynal @ 2023-08-31 6:58 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Linux PM, LKML, Daniel Lezcano, Srinivas Pandruvada, Zhang Rui,
Amit Kucheria, Sebastian Reichel
Hello,
rjw@rjwysocki.net wrote on Wed, 30 Aug 2023 18:14:57 +0200:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> 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 <rafael.j.wysocki@intel.com>
> ---
> drivers/thermal/armada_thermal.c | 5 +++--
For armada:
Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v1 3/4] thermal: Use thermal_tripless_zone_device_register()
2023-08-31 6:58 ` Miquel Raynal
@ 2023-09-04 12:54 ` Rafael J. Wysocki
0 siblings, 0 replies; 9+ messages in thread
From: Rafael J. Wysocki @ 2023-09-04 12:54 UTC (permalink / raw)
To: Miquel Raynal
Cc: Rafael J. Wysocki, Linux PM, LKML, Daniel Lezcano,
Srinivas Pandruvada, Zhang Rui, Amit Kucheria, Sebastian Reichel
On Thu, Aug 31, 2023 at 8:58 AM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> Hello,
>
> rjw@rjwysocki.net wrote on Wed, 30 Aug 2023 18:14:57 +0200:
>
> > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> >
> > 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 <rafael.j.wysocki@intel.com>
> > ---
>
> > drivers/thermal/armada_thermal.c | 5 +++--
>
> For armada:
> Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
Thank you!
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v1 3/4] thermal: Use thermal_tripless_zone_device_register()
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:56 ` Rafael J. Wysocki
2023-09-12 16:30 ` Sebastian Reichel
2 siblings, 0 replies; 9+ messages in thread
From: Rafael J. Wysocki @ 2023-09-04 12:56 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Linux PM, LKML, Daniel Lezcano, Srinivas Pandruvada, Zhang Rui,
Amit Kucheria, Miquel Raynal, Sebastian Reichel
On Wed, Aug 30, 2023 at 8:36 PM Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
>
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> 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 <rafael.j.wysocki@intel.com>
Due to the lack of negative feedback, I'm going to assume that this
patch in particular and the entire series in general is fine with
everyone in the CC.
> ---
> 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);
>
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v1 3/4] thermal: Use thermal_tripless_zone_device_register()
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:56 ` Rafael J. Wysocki
@ 2023-09-12 16:30 ` Sebastian Reichel
2 siblings, 0 replies; 9+ messages in thread
From: Sebastian Reichel @ 2023-09-12 16:30 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Linux PM, LKML, Daniel Lezcano, Srinivas Pandruvada, Zhang Rui,
Amit Kucheria, Miquel Raynal
[-- Attachment #1: Type: text/plain, Size: 5379 bytes --]
Hi,
On Wed, Aug 30, 2023 at 06:14:57PM +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> 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 <rafael.j.wysocki@intel.com>
> ---
> drivers/power/supply/power_supply_core.c | 4 ++--
For power-supply:
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-- Sebastian
> 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);
>
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2023-09-12 16:30 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH v1 2/4] thermal: core: Add function for registering tripless thermal zones Rafael J. Wysocki
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
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).