Commit 4b1bf587 authored by Anton Vorontsov's avatar Anton Vorontsov

thermal: Constify 'type' argument for the registration routine

thermal_zone_device_register() does not modify 'type' argument, so it is
safe to declare it as const. Otherwise, if we pass a const string, we are
getting the ugly warning:

CC drivers/power/power_supply_core.o
drivers/power/power_supply_core.c: In function 'psy_register_thermal':
drivers/power/power_supply_core.c:204:6: warning: passing argument 1 of 'thermal_zone_device_register' discards 'const' qualifier from pointer target type [enabled by default]
include/linux/thermal.h:140:29: note: expected 'char *' but argument is of type 'const char *'
Signed-off-by: default avatarAnton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: default avatarJean Delvare <khali@linux-fr.org>
parent e6db06a5
...@@ -1173,7 +1173,7 @@ static void remove_trip_attrs(struct thermal_zone_device *tz) ...@@ -1173,7 +1173,7 @@ static void remove_trip_attrs(struct thermal_zone_device *tz)
* longer needed. The passive cooling formula uses tc1 and tc2 as described in * longer needed. The passive cooling formula uses tc1 and tc2 as described in
* section 11.1.5.1 of the ACPI specification 3.0. * section 11.1.5.1 of the ACPI specification 3.0.
*/ */
struct thermal_zone_device *thermal_zone_device_register(char *type, struct thermal_zone_device *thermal_zone_device_register(const char *type,
int trips, int mask, void *devdata, int trips, int mask, void *devdata,
const struct thermal_zone_device_ops *ops, const struct thermal_zone_device_ops *ops,
int tc1, int tc2, int passive_delay, int polling_delay) int tc1, int tc2, int passive_delay, int polling_delay)
......
...@@ -146,7 +146,7 @@ enum { ...@@ -146,7 +146,7 @@ enum {
}; };
#define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1) #define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1)
struct thermal_zone_device *thermal_zone_device_register(char *, int, int, struct thermal_zone_device *thermal_zone_device_register(const char *, int, int,
void *, const struct thermal_zone_device_ops *, int tc1, void *, const struct thermal_zone_device_ops *, int tc1,
int tc2, int passive_freq, int polling_freq); int tc2, int passive_freq, int polling_freq);
void thermal_zone_device_unregister(struct thermal_zone_device *); void thermal_zone_device_unregister(struct thermal_zone_device *);
......
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