]> git.baikalelectronics.ru Git - kernel.git/commit
thermal/core: Fix thermal_cooling_device_register() prototype
authorArnd Bergmann <arnd@arndb.de>
Thu, 22 Jul 2021 09:06:44 +0000 (11:06 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Sat, 14 Aug 2021 13:40:26 +0000 (15:40 +0200)
commit95cd65c6f0193b0f7f0c20709db4360e42f118e7
tree01fc25db275ec27f0f47ad801b203ef102fe6d3d
parent976f3e15da0e0370e4db5ef80c52e5faf6a8cd9d
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: 2b1096a29e22 ("thermal: make device_register's type argument const")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Jean-Francois Dagenais <jeff.dagenais@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210722090717.1116748-1-arnd@kernel.org
include/linux/thermal.h