linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Valentin <eduardo.valentin@ti.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org, linux-pm@vger.kernel.org,
	linux-omap@vger.kernel.org,
	Eduardo Valentin <eduardo.valentin@ti.com>
Subject: [PATCH 01/14] staging: ti-soc-thermal: return error in case power switch is not supported
Date: Mon, 1 Apr 2013 12:04:33 -0400	[thread overview]
Message-ID: <1364832286-17304-2-git-send-email-eduardo.valentin@ti.com> (raw)
In-Reply-To: <1364832286-17304-1-git-send-email-eduardo.valentin@ti.com>

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>
---
 drivers/staging/ti-soc-thermal/ti-bandgap.c |    8 +++++---
 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 d479e50..a6aa75f 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;
 }
 
 /**
-- 
1.7.7.1.488.ge8e1c


  reply	other threads:[~2013-04-01 16:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-01 16:04 [PATCH 00/14] staging: ti-soc-thermal: fixes and trending support Eduardo Valentin
2013-04-01 16:04 ` Eduardo Valentin [this message]
2013-04-01 16:04 ` [PATCH 02/14] staging: ti-soc-thermal: remove kernel-doc warnings reported with -v Eduardo Valentin
2013-04-01 16:04 ` [PATCH 03/14] staging: ti-soc-thermal: expose ti_thermal_report_temperature Eduardo Valentin
2013-04-01 16:04 ` [PATCH 04/14] staging: ti-soc-thermal: report alert events on OMAP4 devices Eduardo Valentin
2013-04-01 16:04 ` [PATCH 05/14] staging: ti-soc-thermal: report alert events on OMAP5 devices Eduardo Valentin
2013-04-01 16:04 ` [PATCH 06/14] staging: ti-soc-thermal: Add counter_delay_mask field to temp_sensor_registers struct Eduardo Valentin
2013-04-01 16:04 ` [PATCH 07/14] staging: ti-soc-thermal: Initialise counter_delay field for OMAP5 sensors Eduardo Valentin
2013-04-01 16:04 ` [PATCH 08/14] staging: ti-soc-thermal: Introduce HAS_COUNTER_DELAY feature for bandgap Eduardo Valentin
2013-04-01 16:04 ` [PATCH 09/14] staging: ti-soc-thermal: Enable COUNTER_DELAY feature for OMAP5 Eduardo Valentin
2013-04-01 16:04 ` [PATCH 10/14] staging: ti-soc-thermal: Modify update_interval r/w functions to incorporate the OMAP5 feature of COUNTER_DELAY Eduardo Valentin
2013-04-01 16:04 ` [PATCH 11/14] staging: ti-soc-thermal: Introduce HAS_HISTORY_BUFFER feature for bandgap Eduardo Valentin
2013-04-01 16:04 ` [PATCH 12/14] staging: ti-soc-thermal: Enable HISTORY_BUFFER Feature for OMAP5 Eduardo Valentin
2013-04-01 16:04 ` [PATCH 13/14] staging: ti-soc-thermal:Introduce ti_bandgap_get_trend function " Eduardo Valentin
2013-04-01 16:04 ` [PATCH 14/14] staging: ti-soc-thermal: Add get_trend support Eduardo Valentin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1364832286-17304-2-git-send-email-eduardo.valentin@ti.com \
    --to=eduardo.valentin@ti.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).