diff mbox series

thermal: constify 'type' in devm_thermal_of_cooling_device_register()

Message ID 20240703083141.96013-1-krzysztof.kozlowski@linaro.org (mailing list archive)
State Queued
Delegated to: Rafael Wysocki
Headers show
Series thermal: constify 'type' in devm_thermal_of_cooling_device_register() | expand

Commit Message

Krzysztof Kozlowski July 3, 2024, 8:31 a.m. UTC
The 'type' string passed to thermal_of_cooling_device_register() is a
'const char *', so make the same in the devm interface.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/thermal/thermal_core.c | 2 +-
 include/linux/thermal.h        | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Rafael J. Wysocki July 4, 2024, 12:26 p.m. UTC | #1
On Wed, Jul 3, 2024 at 10:31 AM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> The 'type' string passed to thermal_of_cooling_device_register() is a
> 'const char *', so make the same in the devm interface.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  drivers/thermal/thermal_core.c | 2 +-
>  include/linux/thermal.h        | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index 3fb55060646e..4ea27dd25477 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -1132,7 +1132,7 @@ static void thermal_cooling_device_release(struct device *dev, void *res)
>  struct thermal_cooling_device *
>  devm_thermal_of_cooling_device_register(struct device *dev,
>                                 struct device_node *np,
> -                               char *type, void *devdata,
> +                               const char *type, void *devdata,
>                                 const struct thermal_cooling_device_ops *ops)
>  {
>         struct thermal_cooling_device **ptr, *tcd;
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index f1155c0439c4..f732dab20368 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -261,7 +261,7 @@ thermal_of_cooling_device_register(struct device_node *np, const char *, void *,
>  struct thermal_cooling_device *
>  devm_thermal_of_cooling_device_register(struct device *dev,
>                                 struct device_node *np,
> -                               char *type, void *devdata,
> +                               const char *type, void *devdata,
>                                 const struct thermal_cooling_device_ops *ops);
>  void thermal_cooling_device_update(struct thermal_cooling_device *);
>  void thermal_cooling_device_unregister(struct thermal_cooling_device *);
> @@ -305,7 +305,7 @@ thermal_of_cooling_device_register(struct device_node *np,
>  static inline struct thermal_cooling_device *
>  devm_thermal_of_cooling_device_register(struct device *dev,
>                                 struct device_node *np,
> -                               char *type, void *devdata,
> +                               const char *type, void *devdata,
>                                 const struct thermal_cooling_device_ops *ops)
>  {
>         return ERR_PTR(-ENODEV);
> --

Applied as 6.11 material, thanks!
diff mbox series

Patch

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 3fb55060646e..4ea27dd25477 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -1132,7 +1132,7 @@  static void thermal_cooling_device_release(struct device *dev, void *res)
 struct thermal_cooling_device *
 devm_thermal_of_cooling_device_register(struct device *dev,
 				struct device_node *np,
-				char *type, void *devdata,
+				const char *type, void *devdata,
 				const struct thermal_cooling_device_ops *ops)
 {
 	struct thermal_cooling_device **ptr, *tcd;
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index f1155c0439c4..f732dab20368 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -261,7 +261,7 @@  thermal_of_cooling_device_register(struct device_node *np, const char *, void *,
 struct thermal_cooling_device *
 devm_thermal_of_cooling_device_register(struct device *dev,
 				struct device_node *np,
-				char *type, void *devdata,
+				const char *type, void *devdata,
 				const struct thermal_cooling_device_ops *ops);
 void thermal_cooling_device_update(struct thermal_cooling_device *);
 void thermal_cooling_device_unregister(struct thermal_cooling_device *);
@@ -305,7 +305,7 @@  thermal_of_cooling_device_register(struct device_node *np,
 static inline struct thermal_cooling_device *
 devm_thermal_of_cooling_device_register(struct device *dev,
 				struct device_node *np,
-				char *type, void *devdata,
+				const char *type, void *devdata,
 				const struct thermal_cooling_device_ops *ops)
 {
 	return ERR_PTR(-ENODEV);