From patchwork Thu Mar 28 06:27:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 15717 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id F1F9E23DEE for ; Thu, 28 Mar 2013 06:39:03 +0000 (UTC) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by fiordland.canonical.com (Postfix) with ESMTP id 7C4AEA18647 for ; Thu, 28 Mar 2013 06:39:03 +0000 (UTC) Received: by mail-ve0-f173.google.com with SMTP id cy12so2903131veb.4 for ; Wed, 27 Mar 2013 23:39:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=yqSKKshD9Uy2mR+IAczM/bwFsZinBOeMkrLE++3Kmv4=; b=AwjhbJUM9n4xSE2lyQNYqNyx1Lcb5fnHlbV8KLkUf4+T9v0EFK3QzmZeyv4+X/Ygok w3E1IjFYmwODZSIJMvlBTQRpsW/++EMbK/T+YGc6J3pWva5VjDhrb/TDTH/xF00E7vw5 zhXdGAFp/VnrHo3TdTYTGU9EiumNf+OEIIpFo5eXBL+i/I4+0Ym6jf/eD3PrZLaKm2PA yB6EISIx6j9hdq28h3PkRfFOps8EJXeT5frPUAfnx/JnHigcccQ3KvWH9Ghz94McVvJg NF+UU27ARFlp+DVEqnqsauCxjmyLl648Fup0WmaxKnYZm1yy0LYwY8R8JZDM2qfYyx3r qEkw== X-Received: by 10.52.76.103 with SMTP id j7mr22620691vdw.90.1364452743039; Wed, 27 Mar 2013 23:39:03 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.59.4.204 with SMTP id cg12csp1432ved; Wed, 27 Mar 2013 23:39:02 -0700 (PDT) X-Received: by 10.68.213.167 with SMTP id nt7mr32829915pbc.194.1364452741858; Wed, 27 Mar 2013 23:39:01 -0700 (PDT) Received: from mail-pb0-f47.google.com (mail-pb0-f47.google.com [209.85.160.47]) by mx.google.com with ESMTPS id yz4si25034980pbc.25.2013.03.27.23.39.01 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Mar 2013 23:39:01 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.47 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.47; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.47 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-pb0-f47.google.com with SMTP id rp2so5647754pbb.34 for ; Wed, 27 Mar 2013 23:39:01 -0700 (PDT) X-Received: by 10.66.178.5 with SMTP id cu5mr34865040pac.16.1364452741028; Wed, 27 Mar 2013 23:39:01 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id ce16sm26483940pac.5.2013.03.27.23.38.58 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 27 Mar 2013 23:39:00 -0700 (PDT) From: Sachin Kamat To: linux-kernel@vger.kernel.org Cc: myungjoo.ham@samsung.com, cw00.choi@samsung.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH v2 1/2] extcon: max77693: Fix return value Date: Thu, 28 Mar 2013 11:57:32 +0530 Message-Id: <1364452053-17405-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQnG3epQMIM1d2xbwviHZoA6EllapPopaFg9sHojKqFThIogcbWvh/qQ6I0/cosDugb0kgva Return the value obtained from the function instead of hardcoding. Silences the following warnings: drivers/extcon/extcon-max77693.c:297 max77693_muic_set_path() info: why not propagate 'ret' from max77693_update_reg() instead of (-11)? drivers/extcon/extcon-max77693.c:310 max77693_muic_set_path() info: why not propagate 'ret' from max77693_update_reg() instead of (-11)? Signed-off-by: Sachin Kamat --- Changes since v1: Include additional instances. Compile tested. --- drivers/extcon/extcon-max77693.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c index 8f3c947..924db01 100644 --- a/drivers/extcon/extcon-max77693.c +++ b/drivers/extcon/extcon-max77693.c @@ -258,7 +258,7 @@ static int max77693_muic_set_debounce_time(struct max77693_muic_info *info, CONTROL3_ADCDBSET_MASK); if (ret) { dev_err(info->dev, "failed to set ADC debounce time\n"); - return -EAGAIN; + return ret; } break; default: @@ -294,7 +294,7 @@ static int max77693_muic_set_path(struct max77693_muic_info *info, MAX77693_MUIC_REG_CTRL1, ctrl1, COMP_SW_MASK); if (ret < 0) { dev_err(info->dev, "failed to update MUIC register\n"); - return -EAGAIN; + return ret; } if (attached) @@ -307,7 +307,7 @@ static int max77693_muic_set_path(struct max77693_muic_info *info, CONTROL2_LOWPWR_MASK | CONTROL2_CPEN_MASK); if (ret < 0) { dev_err(info->dev, "failed to update MUIC register\n"); - return -EAGAIN; + return ret; } dev_info(info->dev, @@ -1035,7 +1035,7 @@ static int max77693_muic_detect_accessory(struct max77693_muic_info *info) if (ret) { dev_err(info->dev, "failed to read MUIC register\n"); mutex_unlock(&info->mutex); - return -EINVAL; + return ret; } adc = max77693_muic_get_cable_type(info, MAX77693_CABLE_GROUP_ADC,