830-v6.4-13-thermal-Don-t-use-device-internal-thermal-zone-struc.patch 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. From 5a72b8e4bac753e4dc74dc0a1335d120f63df97a Mon Sep 17 00:00:00 2001
  2. From: Daniel Lezcano <[email protected]>
  3. Date: Wed, 1 Mar 2023 21:14:37 +0100
  4. Subject: [PATCH 09/42] thermal: Don't use 'device' internal thermal zone
  5. structure field
  6. Some drivers are directly using the thermal zone's 'device' structure
  7. field.
  8. Use the driver device pointer instead of the thermal zone device when
  9. it is available.
  10. Remove the traces when they are duplicate with the traces in the core
  11. code.
  12. [again skipped imx_thermal.c]
  13. Cc: Jean Delvare <[email protected]>
  14. Cc: Guenter Roeck <[email protected]>
  15. Signed-off-by: Daniel Lezcano <[email protected]>
  16. Reviewed-by: Balsam CHIHI <[email protected]> #Mediatek LVTS
  17. Reviewed-by: AngeloGioacchino Del Regno <[email protected]> #MediaTek LVTS
  18. Signed-off-by: Rafael J. Wysocki <[email protected]>
  19. ---
  20. drivers/thermal/mediatek/lvts_thermal.c | 4 ++--
  21. drivers/thermal/thermal_hwmon.c | 4 ++--
  22. drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 2 +-
  23. 3 files changed, 5 insertions(+), 5 deletions(-)
  24. --- a/drivers/thermal/mediatek/lvts_thermal.c
  25. +++ b/drivers/thermal/mediatek/lvts_thermal.c
  26. @@ -305,7 +305,7 @@ static int lvts_set_trips(struct thermal
  27. * 14-0 : Raw temperature for threshold
  28. */
  29. if (low != -INT_MAX) {
  30. - dev_dbg(&tz->device, "Setting low limit temperature interrupt: %d\n", low);
  31. + pr_debug("%s: Setting low limit temperature interrupt: %d\n", tz->type, low);
  32. writel(raw_low, LVTS_H2NTHRE(base));
  33. }
  34. @@ -318,7 +318,7 @@ static int lvts_set_trips(struct thermal
  35. *
  36. * 14-0 : Raw temperature for threshold
  37. */
  38. - dev_dbg(&tz->device, "Setting high limit temperature interrupt: %d\n", high);
  39. + pr_debug("%s: Setting high limit temperature interrupt: %d\n", tz->type, high);
  40. writel(raw_high, LVTS_HTHRE(base));
  41. return 0;
  42. --- a/drivers/thermal/thermal_hwmon.c
  43. +++ b/drivers/thermal/thermal_hwmon.c
  44. @@ -220,14 +220,14 @@ void thermal_remove_hwmon_sysfs(struct t
  45. hwmon = thermal_hwmon_lookup_by_type(tz);
  46. if (unlikely(!hwmon)) {
  47. /* Should never happen... */
  48. - dev_dbg(&tz->device, "hwmon device lookup failed!\n");
  49. + dev_dbg(hwmon->device, "hwmon device lookup failed!\n");
  50. return;
  51. }
  52. temp = thermal_hwmon_lookup_temp(hwmon, tz);
  53. if (unlikely(!temp)) {
  54. /* Should never happen... */
  55. - dev_dbg(&tz->device, "temperature input lookup failed!\n");
  56. + dev_dbg(hwmon->device, "temperature input lookup failed!\n");
  57. return;
  58. }
  59. --- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
  60. +++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
  61. @@ -43,7 +43,7 @@ static void ti_thermal_work(struct work_
  62. thermal_zone_device_update(data->ti_thermal, THERMAL_EVENT_UNSPECIFIED);
  63. - dev_dbg(&data->ti_thermal->device, "updated thermal zone %s\n",
  64. + dev_dbg(data->bgp->dev, "updated thermal zone %s\n",
  65. data->ti_thermal->type);
  66. }