020-intel-mld-compile.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. Fix Intel mld thermal compilation
  2. Do the same changes done also in iwlwifi/mvm/tt.c in the iwlwifi/mld/thermal.c file.
  3. This fixes the compilation.
  4. --- a/drivers/net/wireless/intel/iwlwifi/mld/thermal.c
  5. +++ b/drivers/net/wireless/intel/iwlwifi/mld/thermal.c
  6. @@ -209,9 +209,15 @@ unlock:
  7. return ret;
  8. }
  9. +#if LINUX_VERSION_IS_GEQ(6,11,0)
  10. static int iwl_mld_tzone_set_trip_temp(struct thermal_zone_device *device,
  11. const struct thermal_trip *trip,
  12. int temp)
  13. +#else
  14. +static int iwl_mld_tzone_set_trip_temp(struct thermal_zone_device *device,
  15. + int trip,
  16. + int temp)
  17. +#endif
  18. {
  19. struct iwl_mld *mld = thermal_zone_device_priv(device);
  20. int ret;
  21. @@ -248,18 +254,29 @@ static void iwl_mld_thermal_zone_registe
  22. [0 ... IWL_MAX_DTS_TRIPS - 1] = {
  23. .temperature = THERMAL_TEMP_INVALID,
  24. .type = THERMAL_TRIP_PASSIVE,
  25. +#if LINUX_VERSION_IS_GEQ(6,9,0)
  26. .flags = THERMAL_TRIP_FLAG_RW_TEMP,
  27. +#endif
  28. },
  29. };
  30. BUILD_BUG_ON(ARRAY_SIZE(name) >= THERMAL_NAME_LENGTH);
  31. sprintf(name, "iwlwifi_%u", atomic_inc_return(&counter) & 0xFF);
  32. +#if LINUX_VERSION_IS_GEQ(6,9,0)
  33. mld->tzone =
  34. thermal_zone_device_register_with_trips(name, trips,
  35. IWL_MAX_DTS_TRIPS,
  36. mld, &tzone_ops,
  37. NULL, 0, 0);
  38. +#else
  39. + mld->tzone =
  40. + thermal_zone_device_register_with_trips(name, trips,
  41. + IWL_MAX_DTS_TRIPS, 0,
  42. + mld, &tzone_ops,
  43. + NULL, 0, 0);
  44. +#endif
  45. +
  46. if (IS_ERR(mld->tzone)) {
  47. IWL_DEBUG_TEMP(mld,
  48. "Failed to register to thermal zone (err = %ld)\n",