diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2023-08-10 22:09:54 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2023-08-11 19:44:44 +0300 |
commit | 4f16443596f4d3dcf0474f8c753219bd6b9470f2 (patch) | |
tree | 8aefb3cf7771203a8dadd16758352dd2ed536585 /drivers/thermal | |
parent | a39524aca314a93100cafa49f0a0cf0508a00d1e (diff) | |
download | linux-4f16443596f4d3dcf0474f8c753219bd6b9470f2.tar.xz |
thermal: intel: intel_soc_dts_iosf: Always assume notification support
None of the existing callers of intel_soc_dts_iosf_init() passes
INTEL_SOC_DTS_INTERRUPT_NONE as the first argument to it, so the
notification local variable in it is always true and the
notification_support argument of add_dts_thermal_zone() is always
true either.
For this reason, drop the notification local variable from
intel_soc_dts_iosf_init() and the notification_support argument from
add_dts_thermal_zone() and rearrange the latter to always set
writable_trip_cnt and trip_mask.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r-- | drivers/thermal/intel/intel_soc_dts_iosf.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/drivers/thermal/intel/intel_soc_dts_iosf.c b/drivers/thermal/intel/intel_soc_dts_iosf.c index 60bdca997c21..5c5790d6e786 100644 --- a/drivers/thermal/intel/intel_soc_dts_iosf.c +++ b/drivers/thermal/intel/intel_soc_dts_iosf.c @@ -247,12 +247,12 @@ static void remove_dts_thermal_zone(struct intel_soc_dts_sensor_entry *dts) } static int add_dts_thermal_zone(int id, struct intel_soc_dts_sensor_entry *dts, - bool notification_support, int read_only_trip_cnt) + int read_only_trip_cnt) { char name[10]; unsigned long trip; - int trip_mask = 0; - int writable_trip_cnt = 0; + int writable_trip_cnt; + int trip_mask; unsigned long ptps; u32 store_ptps; unsigned long i; @@ -265,10 +265,9 @@ static int add_dts_thermal_zone(int id, struct intel_soc_dts_sensor_entry *dts, goto err_ret; dts->id = id; - if (notification_support) { - writable_trip_cnt = SOC_MAX_DTS_TRIPS - read_only_trip_cnt; - trip_mask = GENMASK(writable_trip_cnt - 1, 0); - } + + writable_trip_cnt = SOC_MAX_DTS_TRIPS - read_only_trip_cnt; + trip_mask = GENMASK(writable_trip_cnt - 1, 0); /* Check if the writable trip we provide is not used by BIOS */ ret = iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ, @@ -364,7 +363,6 @@ struct intel_soc_dts_sensors *intel_soc_dts_iosf_init( enum intel_soc_dts_interrupt_type intr_type, int read_only_trip_count) { struct intel_soc_dts_sensors *sensors; - bool notification; int tj_max; int ret; int i; @@ -387,14 +385,11 @@ struct intel_soc_dts_sensors *intel_soc_dts_iosf_init( mutex_init(&sensors->dts_update_lock); sensors->intr_type = intr_type; sensors->tj_max = tj_max * 1000; - if (intr_type == INTEL_SOC_DTS_INTERRUPT_NONE) - notification = false; - else - notification = true; + for (i = 0; i < SOC_MAX_DTS_SENSORS; ++i) { sensors->soc_dts[i].sensors = sensors; ret = add_dts_thermal_zone(i, &sensors->soc_dts[i], - notification, read_only_trip_count); + read_only_trip_count); if (ret) goto err_free; } |