From patchwork Mon Apr 1 16:04:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 2371361 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 83915DFB7B for ; Mon, 1 Apr 2013 16:05:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758899Ab3DAQFj (ORCPT ); Mon, 1 Apr 2013 12:05:39 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:45963 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758839Ab3DAQFj (ORCPT ); Mon, 1 Apr 2013 12:05:39 -0400 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r31G5VsX004560; Mon, 1 Apr 2013 11:05:31 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r31G5Vuk016219; Mon, 1 Apr 2013 11:05:31 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.2.342.3; Mon, 1 Apr 2013 11:05:31 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id r31G5VGu021151; Mon, 1 Apr 2013 11:05:31 -0500 Received: from localhost (h64-8.vpn.ti.com [172.24.64.8]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id r31G5SV04448; Mon, 1 Apr 2013 11:05:28 -0500 (CDT) From: Eduardo Valentin To: Greg Kroah-Hartman CC: , , , Eduardo Valentin 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 Message-ID: <1364832286-17304-2-git-send-email-eduardo.valentin@ti.com> X-Mailer: git-send-email 1.7.7.1.488.ge8e1c In-Reply-To: <1364832286-17304-1-git-send-email-eduardo.valentin@ti.com> References: <1364832286-17304-1-git-send-email-eduardo.valentin@ti.com> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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 --- 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; } /**