Commit e49c8ed8 authored by Daniel Lezcano's avatar Daniel Lezcano Committed by Rafael J. Wysocki

thermal/drivers/int340x: Do not check the thermal zone state

The driver is accessing the thermal zone state to ensure the state is
different from the one we want to set.

We don't want the driver to access the thermal zone device internals.

Actually, the thermal core code already checks if the thermal zone's
state is different before calling this function, thus this check is
duplicate.

Remove it.
Acked-by: default avatarsrinivas pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 12ad93ab
...@@ -503,32 +503,28 @@ static int int3400_thermal_change_mode(struct thermal_zone_device *thermal, ...@@ -503,32 +503,28 @@ static int int3400_thermal_change_mode(struct thermal_zone_device *thermal,
{ {
struct int3400_thermal_priv *priv = thermal_zone_device_priv(thermal); struct int3400_thermal_priv *priv = thermal_zone_device_priv(thermal);
int result = 0; int result = 0;
int enabled;
if (!priv) if (!priv)
return -EINVAL; return -EINVAL;
if (mode != thermal->mode) { enabled = mode == THERMAL_DEVICE_ENABLED;
int enabled;
enabled = mode == THERMAL_DEVICE_ENABLED; if (priv->os_uuid_mask) {
if (!enabled) {
if (priv->os_uuid_mask) { priv->os_uuid_mask = 0;
if (!enabled) { result = set_os_uuid_mask(priv, priv->os_uuid_mask);
priv->os_uuid_mask = 0;
result = set_os_uuid_mask(priv, priv->os_uuid_mask);
}
goto eval_odvp;
} }
goto eval_odvp;
if (priv->current_uuid_index < 0 ||
priv->current_uuid_index >= INT3400_THERMAL_MAXIMUM_UUID)
return -EINVAL;
result = int3400_thermal_run_osc(priv->adev->handle,
int3400_thermal_uuids[priv->current_uuid_index],
&enabled);
} }
if (priv->current_uuid_index < 0 ||
priv->current_uuid_index >= INT3400_THERMAL_MAXIMUM_UUID)
return -EINVAL;
result = int3400_thermal_run_osc(priv->adev->handle,
int3400_thermal_uuids[priv->current_uuid_index],
&enabled);
eval_odvp: eval_odvp:
evaluate_odvp(priv); evaluate_odvp(priv);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment