Skip to content

Commit 32bf43e

Browse files
committed
Merge tag 'thermal-6.6-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull more thermal control updates from Rafael Wysocki: "Eliminate an obsolete thermal zone registration function" * tag 'thermal-6.6-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: thermal: core: Drop thermal_zone_device_register() thermal: Use thermal_tripless_zone_device_register() thermal: core: Add function for registering tripless thermal zones thermal: core: Clean up headers of thermal zone registration functions
2 parents fd88c59 + edd220b commit 32bf43e

File tree

8 files changed

+56
-38
lines changed

8 files changed

+56
-38
lines changed

drivers/power/supply/power_supply_core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,8 +1309,8 @@ static int psy_register_thermal(struct power_supply *psy)
13091309
struct thermal_zone_params tzp = {
13101310
.no_hwmon = IS_ENABLED(CONFIG_POWER_SUPPLY_HWMON)
13111311
};
1312-
psy->tzd = thermal_zone_device_register(psy->desc->name,
1313-
0, 0, psy, &psy_tzd_ops, &tzp, 0, 0);
1312+
psy->tzd = thermal_tripless_zone_device_register(psy->desc->name,
1313+
psy, &psy_tzd_ops, &tzp);
13141314
if (IS_ERR(psy->tzd))
13151315
return PTR_ERR(psy->tzd);
13161316
ret = thermal_zone_device_enable(psy->tzd);

drivers/thermal/armada_thermal.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -876,8 +876,9 @@ static int armada_thermal_probe(struct platform_device *pdev)
876876
/* Wait the sensors to be valid */
877877
armada_wait_sensor_validity(priv);
878878

879-
tz = thermal_zone_device_register(priv->zone_name, 0, 0, priv,
880-
&legacy_ops, NULL, 0, 0);
879+
tz = thermal_tripless_zone_device_register(priv->zone_name,
880+
priv, &legacy_ops,
881+
NULL);
881882
if (IS_ERR(tz)) {
882883
dev_err(&pdev->dev,
883884
"Failed to register thermal zone device\n");

drivers/thermal/dove_thermal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ static int dove_thermal_probe(struct platform_device *pdev)
139139
return ret;
140140
}
141141

142-
thermal = thermal_zone_device_register("dove_thermal", 0, 0,
143-
priv, &ops, NULL, 0, 0);
142+
thermal = thermal_tripless_zone_device_register("dove_thermal", priv,
143+
&ops, NULL);
144144
if (IS_ERR(thermal)) {
145145
dev_err(&pdev->dev,
146146
"Failed to register thermal zone device\n");

drivers/thermal/intel/int340x_thermal/int3400_thermal.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,9 +609,9 @@ static int int3400_thermal_probe(struct platform_device *pdev)
609609

610610
evaluate_odvp(priv);
611611

612-
priv->thermal = thermal_zone_device_register("INT3400 Thermal", 0, 0,
613-
priv, &int3400_thermal_ops,
614-
&int3400_thermal_params, 0, 0);
612+
priv->thermal = thermal_tripless_zone_device_register("INT3400 Thermal", priv,
613+
&int3400_thermal_ops,
614+
&int3400_thermal_params);
615615
if (IS_ERR(priv->thermal)) {
616616
result = PTR_ERR(priv->thermal);
617617
goto free_art_trt;

drivers/thermal/kirkwood_thermal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ static int kirkwood_thermal_probe(struct platform_device *pdev)
7171
if (IS_ERR(priv->sensor))
7272
return PTR_ERR(priv->sensor);
7373

74-
thermal = thermal_zone_device_register("kirkwood_thermal", 0, 0,
75-
priv, &ops, NULL, 0, 0);
74+
thermal = thermal_tripless_zone_device_register("kirkwood_thermal",
75+
priv, &ops, NULL);
7676
if (IS_ERR(thermal)) {
7777
dev_err(&pdev->dev,
7878
"Failed to register thermal zone device\n");

drivers/thermal/spear_thermal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ static int spear_thermal_probe(struct platform_device *pdev)
122122
stdev->flags = val;
123123
writel_relaxed(stdev->flags, stdev->thermal_base);
124124

125-
spear_thermal = thermal_zone_device_register("spear_thermal", 0, 0,
126-
stdev, &ops, NULL, 0, 0);
125+
spear_thermal = thermal_tripless_zone_device_register("spear_thermal",
126+
stdev, &ops, NULL);
127127
if (IS_ERR(spear_thermal)) {
128128
dev_err(&pdev->dev, "thermal zone device is NULL\n");
129129
ret = PTR_ERR(spear_thermal);

drivers/thermal/thermal_core.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,16 +1389,16 @@ thermal_zone_device_register_with_trips(const char *type, struct thermal_trip *t
13891389
}
13901390
EXPORT_SYMBOL_GPL(thermal_zone_device_register_with_trips);
13911391

1392-
struct thermal_zone_device *thermal_zone_device_register(const char *type, int ntrips, int mask,
1393-
void *devdata, struct thermal_zone_device_ops *ops,
1394-
const struct thermal_zone_params *tzp, int passive_delay,
1395-
int polling_delay)
1392+
struct thermal_zone_device *thermal_tripless_zone_device_register(
1393+
const char *type,
1394+
void *devdata,
1395+
struct thermal_zone_device_ops *ops,
1396+
const struct thermal_zone_params *tzp)
13961397
{
1397-
return thermal_zone_device_register_with_trips(type, NULL, ntrips, mask,
1398-
devdata, ops, tzp,
1399-
passive_delay, polling_delay);
1398+
return thermal_zone_device_register_with_trips(type, NULL, 0, 0, devdata,
1399+
ops, tzp, 0, 0);
14001400
}
1401-
EXPORT_SYMBOL_GPL(thermal_zone_device_register);
1401+
EXPORT_SYMBOL_GPL(thermal_tripless_zone_device_register);
14021402

14031403
void *thermal_zone_device_priv(struct thermal_zone_device *tzd)
14041404
{

include/linux/thermal.h

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -300,16 +300,22 @@ int thermal_acpi_critical_trip_temp(struct acpi_device *adev, int *ret_temp);
300300
#endif
301301

302302
#ifdef CONFIG_THERMAL
303-
struct thermal_zone_device *thermal_zone_device_register(const char *, int, int,
304-
void *, struct thermal_zone_device_ops *,
305-
const struct thermal_zone_params *, int, int);
306-
307-
void thermal_zone_device_unregister(struct thermal_zone_device *);
308-
309-
struct thermal_zone_device *
310-
thermal_zone_device_register_with_trips(const char *, struct thermal_trip *, int, int,
311-
void *, struct thermal_zone_device_ops *,
312-
const struct thermal_zone_params *, int, int);
303+
struct thermal_zone_device *thermal_zone_device_register_with_trips(
304+
const char *type,
305+
struct thermal_trip *trips,
306+
int num_trips, int mask,
307+
void *devdata,
308+
struct thermal_zone_device_ops *ops,
309+
const struct thermal_zone_params *tzp,
310+
int passive_delay, int polling_delay);
311+
312+
struct thermal_zone_device *thermal_tripless_zone_device_register(
313+
const char *type,
314+
void *devdata,
315+
struct thermal_zone_device_ops *ops,
316+
const struct thermal_zone_params *tzp);
317+
318+
void thermal_zone_device_unregister(struct thermal_zone_device *tz);
313319

314320
void *thermal_zone_device_priv(struct thermal_zone_device *tzd);
315321
const char *thermal_zone_device_type(struct thermal_zone_device *tzd);
@@ -350,15 +356,26 @@ int thermal_zone_device_enable(struct thermal_zone_device *tz);
350356
int thermal_zone_device_disable(struct thermal_zone_device *tz);
351357
void thermal_zone_device_critical(struct thermal_zone_device *tz);
352358
#else
353-
static inline struct thermal_zone_device *thermal_zone_device_register(
354-
const char *type, int trips, int mask, void *devdata,
355-
struct thermal_zone_device_ops *ops,
356-
const struct thermal_zone_params *tzp,
357-
int passive_delay, int polling_delay)
359+
static inline struct thermal_zone_device *thermal_zone_device_register_with_trips(
360+
const char *type,
361+
struct thermal_trip *trips,
362+
int num_trips, int mask,
363+
void *devdata,
364+
struct thermal_zone_device_ops *ops,
365+
const struct thermal_zone_params *tzp,
366+
int passive_delay, int polling_delay)
367+
{ return ERR_PTR(-ENODEV); }
368+
369+
static inline struct thermal_zone_device *thermal_tripless_zone_device_register(
370+
const char *type,
371+
void *devdata,
372+
struct thermal_zone_device_ops *ops,
373+
const struct thermal_zone_params *tzp)
358374
{ return ERR_PTR(-ENODEV); }
359-
static inline void thermal_zone_device_unregister(
360-
struct thermal_zone_device *tz)
375+
376+
static inline void thermal_zone_device_unregister(struct thermal_zone_device *tz)
361377
{ }
378+
362379
static inline struct thermal_cooling_device *
363380
thermal_cooling_device_register(const char *type, void *devdata,
364381
const struct thermal_cooling_device_ops *ops)

0 commit comments

Comments
 (0)