Skip to content

Commit 80ddce5

Browse files
a3frafaeljw
authored andcommitted
thermal: core: constify params in thermal_zone_device_register
Since commit 3d439b1 ("thermal/core: Alloc-copy-free the thermal zone parameters structure"), thermal_zone_device_register() allocates a copy of the tzp argument and callers need not explicitly manage its lifetime. This means the function no longer cares about the parameter being mutable, so constify it. No functional change. Signed-off-by: Ahmad Fatoum <[email protected]> Acked-by: Daniel Lezcano <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 6eaae19 commit 80ddce5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

drivers/thermal/thermal_core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,7 @@ EXPORT_SYMBOL_GPL(thermal_zone_get_crit_temp);
12031203
struct thermal_zone_device *
12041204
thermal_zone_device_register_with_trips(const char *type, struct thermal_trip *trips, int num_trips, int mask,
12051205
void *devdata, struct thermal_zone_device_ops *ops,
1206-
struct thermal_zone_params *tzp, int passive_delay,
1206+
const struct thermal_zone_params *tzp, int passive_delay,
12071207
int polling_delay)
12081208
{
12091209
struct thermal_zone_device *tz;
@@ -1371,7 +1371,7 @@ EXPORT_SYMBOL_GPL(thermal_zone_device_register_with_trips);
13711371

13721372
struct thermal_zone_device *thermal_zone_device_register(const char *type, int ntrips, int mask,
13731373
void *devdata, struct thermal_zone_device_ops *ops,
1374-
struct thermal_zone_params *tzp, int passive_delay,
1374+
const struct thermal_zone_params *tzp, int passive_delay,
13751375
int polling_delay)
13761376
{
13771377
return thermal_zone_device_register_with_trips(type, NULL, ntrips, mask,

include/linux/thermal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,14 +301,14 @@ int thermal_acpi_critical_trip_temp(struct acpi_device *adev, int *ret_temp);
301301
#ifdef CONFIG_THERMAL
302302
struct thermal_zone_device *thermal_zone_device_register(const char *, int, int,
303303
void *, struct thermal_zone_device_ops *,
304-
struct thermal_zone_params *, int, int);
304+
const struct thermal_zone_params *, int, int);
305305

306306
void thermal_zone_device_unregister(struct thermal_zone_device *);
307307

308308
struct thermal_zone_device *
309309
thermal_zone_device_register_with_trips(const char *, struct thermal_trip *, int, int,
310310
void *, struct thermal_zone_device_ops *,
311-
struct thermal_zone_params *, int, int);
311+
const struct thermal_zone_params *, int, int);
312312

313313
void *thermal_zone_device_priv(struct thermal_zone_device *tzd);
314314
const char *thermal_zone_device_type(struct thermal_zone_device *tzd);
@@ -348,7 +348,7 @@ void thermal_zone_device_critical(struct thermal_zone_device *tz);
348348
static inline struct thermal_zone_device *thermal_zone_device_register(
349349
const char *type, int trips, int mask, void *devdata,
350350
struct thermal_zone_device_ops *ops,
351-
struct thermal_zone_params *tzp,
351+
const struct thermal_zone_params *tzp,
352352
int passive_delay, int polling_delay)
353353
{ return ERR_PTR(-ENODEV); }
354354
static inline void thermal_zone_device_unregister(

0 commit comments

Comments
 (0)