Commit 80ddce5f authored by Ahmad Fatoum's avatar Ahmad Fatoum Committed by Rafael J. Wysocki

thermal: core: constify params in thermal_zone_device_register

Since commit 3d439b1a ("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: default avatarAhmad Fatoum <a.fatoum@pengutronix.de>
Acked-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 6eaae198
...@@ -1203,7 +1203,7 @@ EXPORT_SYMBOL_GPL(thermal_zone_get_crit_temp); ...@@ -1203,7 +1203,7 @@ EXPORT_SYMBOL_GPL(thermal_zone_get_crit_temp);
struct thermal_zone_device * struct thermal_zone_device *
thermal_zone_device_register_with_trips(const char *type, struct thermal_trip *trips, int num_trips, int mask, 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, void *devdata, struct thermal_zone_device_ops *ops,
struct thermal_zone_params *tzp, int passive_delay, const struct thermal_zone_params *tzp, int passive_delay,
int polling_delay) int polling_delay)
{ {
struct thermal_zone_device *tz; struct thermal_zone_device *tz;
...@@ -1371,7 +1371,7 @@ EXPORT_SYMBOL_GPL(thermal_zone_device_register_with_trips); ...@@ -1371,7 +1371,7 @@ EXPORT_SYMBOL_GPL(thermal_zone_device_register_with_trips);
struct thermal_zone_device *thermal_zone_device_register(const char *type, int ntrips, int mask, struct thermal_zone_device *thermal_zone_device_register(const char *type, int ntrips, int mask,
void *devdata, struct thermal_zone_device_ops *ops, void *devdata, struct thermal_zone_device_ops *ops,
struct thermal_zone_params *tzp, int passive_delay, const struct thermal_zone_params *tzp, int passive_delay,
int polling_delay) int polling_delay)
{ {
return thermal_zone_device_register_with_trips(type, NULL, ntrips, mask, return thermal_zone_device_register_with_trips(type, NULL, ntrips, mask,
......
...@@ -301,14 +301,14 @@ int thermal_acpi_critical_trip_temp(struct acpi_device *adev, int *ret_temp); ...@@ -301,14 +301,14 @@ int thermal_acpi_critical_trip_temp(struct acpi_device *adev, int *ret_temp);
#ifdef CONFIG_THERMAL #ifdef CONFIG_THERMAL
struct thermal_zone_device *thermal_zone_device_register(const char *, int, int, struct thermal_zone_device *thermal_zone_device_register(const char *, int, int,
void *, struct thermal_zone_device_ops *, void *, struct thermal_zone_device_ops *,
struct thermal_zone_params *, int, int); const struct thermal_zone_params *, int, int);
void thermal_zone_device_unregister(struct thermal_zone_device *); void thermal_zone_device_unregister(struct thermal_zone_device *);
struct thermal_zone_device * struct thermal_zone_device *
thermal_zone_device_register_with_trips(const char *, struct thermal_trip *, int, int, thermal_zone_device_register_with_trips(const char *, struct thermal_trip *, int, int,
void *, struct thermal_zone_device_ops *, void *, struct thermal_zone_device_ops *,
struct thermal_zone_params *, int, int); const struct thermal_zone_params *, int, int);
void *thermal_zone_device_priv(struct thermal_zone_device *tzd); void *thermal_zone_device_priv(struct thermal_zone_device *tzd);
const char *thermal_zone_device_type(struct thermal_zone_device *tzd); 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); ...@@ -348,7 +348,7 @@ void thermal_zone_device_critical(struct thermal_zone_device *tz);
static inline struct thermal_zone_device *thermal_zone_device_register( static inline struct thermal_zone_device *thermal_zone_device_register(
const char *type, int trips, int mask, void *devdata, const char *type, int trips, int mask, void *devdata,
struct thermal_zone_device_ops *ops, struct thermal_zone_device_ops *ops,
struct thermal_zone_params *tzp, const struct thermal_zone_params *tzp,
int passive_delay, int polling_delay) int passive_delay, int polling_delay)
{ return ERR_PTR(-ENODEV); } { return ERR_PTR(-ENODEV); }
static inline void thermal_zone_device_unregister( static inline void thermal_zone_device_unregister(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment