Skip to content

Commit fb83610

Browse files
arndbdlezcano
authored andcommitted
thermal/core: Fix thermal_cooling_device_register() prototype
There are two pairs of declarations for thermal_cooling_device_register() and thermal_of_cooling_device_register(), and only one set was changed in a recent patch, so the other one now causes a compile-time warning: drivers/net/wireless/mediatek/mt76/mt7915/init.c: In function 'mt7915_thermal_init': drivers/net/wireless/mediatek/mt76/mt7915/init.c:134:48: error: passing argument 1 of 'thermal_cooling_device_register' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] 134 | cdev = thermal_cooling_device_register(wiphy_name(wiphy), phy, | ^~~~~~~~~~~~~~~~~ In file included from drivers/net/wireless/mediatek/mt76/mt7915/init.c:7: include/linux/thermal.h:407:39: note: expected 'char *' but argument is of type 'const char *' 407 | thermal_cooling_device_register(char *type, void *devdata, | ~~~~~~^~~~ Change the dummy helper functions to have the same arguments as the normal version. Fixes: f991de5 ("thermal: make device_register's type argument const") Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Jean-Francois Dagenais <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent f1b07a1 commit fb83610

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

include/linux/thermal.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,13 @@ static inline void thermal_zone_device_unregister(
404404
struct thermal_zone_device *tz)
405405
{ }
406406
static inline struct thermal_cooling_device *
407-
thermal_cooling_device_register(char *type, void *devdata,
407+
thermal_cooling_device_register(const char *type, void *devdata,
408408
const struct thermal_cooling_device_ops *ops)
409409
{ return ERR_PTR(-ENODEV); }
410410
static inline struct thermal_cooling_device *
411411
thermal_of_cooling_device_register(struct device_node *np,
412-
char *type, void *devdata, const struct thermal_cooling_device_ops *ops)
412+
const char *type, void *devdata,
413+
const struct thermal_cooling_device_ops *ops)
413414
{ return ERR_PTR(-ENODEV); }
414415
static inline struct thermal_cooling_device *
415416
devm_thermal_of_cooling_device_register(struct device *dev,

0 commit comments

Comments
 (0)