Skip to content

Commit 4f16443

Browse files
committed
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>
1 parent a39524a commit 4f16443

1 file changed

Lines changed: 8 additions & 13 deletions

File tree

drivers/thermal/intel/intel_soc_dts_iosf.c

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,12 @@ static void remove_dts_thermal_zone(struct intel_soc_dts_sensor_entry *dts)
247247
}
248248

249249
static int add_dts_thermal_zone(int id, struct intel_soc_dts_sensor_entry *dts,
250-
bool notification_support, int read_only_trip_cnt)
250+
int read_only_trip_cnt)
251251
{
252252
char name[10];
253253
unsigned long trip;
254-
int trip_mask = 0;
255-
int writable_trip_cnt = 0;
254+
int writable_trip_cnt;
255+
int trip_mask;
256256
unsigned long ptps;
257257
u32 store_ptps;
258258
unsigned long i;
@@ -265,10 +265,9 @@ static int add_dts_thermal_zone(int id, struct intel_soc_dts_sensor_entry *dts,
265265
goto err_ret;
266266

267267
dts->id = id;
268-
if (notification_support) {
269-
writable_trip_cnt = SOC_MAX_DTS_TRIPS - read_only_trip_cnt;
270-
trip_mask = GENMASK(writable_trip_cnt - 1, 0);
271-
}
268+
269+
writable_trip_cnt = SOC_MAX_DTS_TRIPS - read_only_trip_cnt;
270+
trip_mask = GENMASK(writable_trip_cnt - 1, 0);
272271

273272
/* Check if the writable trip we provide is not used by BIOS */
274273
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(
364363
enum intel_soc_dts_interrupt_type intr_type, int read_only_trip_count)
365364
{
366365
struct intel_soc_dts_sensors *sensors;
367-
bool notification;
368366
int tj_max;
369367
int ret;
370368
int i;
@@ -387,14 +385,11 @@ struct intel_soc_dts_sensors *intel_soc_dts_iosf_init(
387385
mutex_init(&sensors->dts_update_lock);
388386
sensors->intr_type = intr_type;
389387
sensors->tj_max = tj_max * 1000;
390-
if (intr_type == INTEL_SOC_DTS_INTERRUPT_NONE)
391-
notification = false;
392-
else
393-
notification = true;
388+
394389
for (i = 0; i < SOC_MAX_DTS_SENSORS; ++i) {
395390
sensors->soc_dts[i].sensors = sensors;
396391
ret = add_dts_thermal_zone(i, &sensors->soc_dts[i],
397-
notification, read_only_trip_count);
392+
read_only_trip_count);
398393
if (ret)
399394
goto err_free;
400395
}

0 commit comments

Comments
 (0)