提交 422a3063 编写于 作者: E Eduardo Valentin 提交者: Greg Kroah-Hartman

staging: ti-soc-thermal: return error in case power switch is not supported

Improve ti_bandgap_power by returning an error code in case
the device does not support controlling its power state.
Signed-off-by: NEduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 af56976d
......@@ -100,17 +100,19 @@ do { \
*/
static int ti_bandgap_power(struct ti_bandgap *bgp, bool on)
{
int i;
int i, ret = 0;
if (!TI_BANDGAP_HAS(bgp, POWER_SWITCH))
if (!TI_BANDGAP_HAS(bgp, POWER_SWITCH)) {
ret = -ENOTSUPP;
goto exit;
}
for (i = 0; i < bgp->conf->sensor_count; i++)
/* active on 0 */
RMW_BITS(bgp, i, temp_sensor_ctrl, bgap_tempsoff_mask, !on);
exit:
return 0;
return ret;
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册