summaryrefslogtreecommitdiff
path: root/drivers/staging/ti-soc-thermal
diff options
context:
space:
mode:
authorEduardo Valentin <eduardo.valentin@ti.com>2013-04-01 12:04:33 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-04-01 12:27:28 -0700
commit422a3063802c9c1f9ef1bf7daa71038b91aff2ab (patch)
treeda603444ef7dfd87f395a3ae9e4ddec6a195457d /drivers/staging/ti-soc-thermal
parentaf56976dd21efe8e91d5175913c2b1f7be91c651 (diff)
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: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ti-soc-thermal')
-rw-r--r--drivers/staging/ti-soc-thermal/ti-bandgap.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/staging/ti-soc-thermal/ti-bandgap.c b/drivers/staging/ti-soc-thermal/ti-bandgap.c
index d479e507b8b1..a6aa75f6302c 100644
--- a/drivers/staging/ti-soc-thermal/ti-bandgap.c
+++ b/drivers/staging/ti-soc-thermal/ti-bandgap.c
@@ -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;
}
/**