Skip to content

Commit

Permalink
staging: ti-soc-thermal: return error in case power switch is not sup…
Browse files Browse the repository at this point in the history
…ported

Improve ti_bandgap_power by returning an error code in case
the device does not support controlling its power state.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Eduardo Valentin authored and Greg Kroah-Hartman committed Apr 1, 2013
1 parent af56976 commit 422a306
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/staging/ti-soc-thermal/ti-bandgap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 422a306

Please sign in to comment.