The driver is calling get_thermal_instance() but the lookup can happen directly. Remove the call to get_thermal_instance(). Signed-off-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx> --- drivers/thermal/tegra/soctherm.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c index 8e303e9d1dc0..355fdf32cbc1 100644 --- a/drivers/thermal/tegra/soctherm.c +++ b/drivers/thermal/tegra/soctherm.c @@ -621,9 +621,8 @@ static int tegra_thermctl_set_trip_temp(void *data, int trip, int temp) continue; cdev = ts->throt_cfgs[i].cdev; - if (get_thermal_instance(tz, cdev, trip)) - stc = find_throttle_cfg_by_name(ts, cdev->type); - else + stc = find_throttle_cfg_by_name(ts, cdev->type); + if (!stc) continue; return throttrip_program(dev, sg, stc, temp); @@ -806,9 +805,8 @@ static int tegra_soctherm_set_hwtrips(struct device *dev, continue; cdev = ts->throt_cfgs[i].cdev; - if (get_thermal_instance(tz, cdev, trip)) - stc = find_throttle_cfg_by_name(ts, cdev->type); - else + stc = find_throttle_cfg_by_name(ts, cdev->type); + if (!stc) continue; ret = throttrip_program(dev, sg, stc, temperature); -- 2.25.1