From patchwork Thu Mar 28 06:27:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 15718 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 930A923DEE for ; Thu, 28 Mar 2013 06:39:05 +0000 (UTC) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by fiordland.canonical.com (Postfix) with ESMTP id 4B2B4A18647 for ; Thu, 28 Mar 2013 06:39:05 +0000 (UTC) Received: by mail-vc0-f176.google.com with SMTP id ib11so7162064vcb.7 for ; Wed, 27 Mar 2013 23:39:04 -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 :in-reply-to:references:x-gm-message-state; bh=NWhgiti0+MTIkm6Qvp98x+unuPfxS+Ee08Z1MQKFtNM=; b=FT0COvYRuaQr8ByutagFIGKQ2MU1YUkcypGUB1s5Rcc7tsiivNdP0Ypv9gExGGYI9Y Qtp5+6EPq8q2gAUePlR/1wR5t6snVYhYkR5gUXVmur9XP0jxa5bBaZLalAbYGyTXoZwD Cv6fi2kn1z850FF1GNzirBnT8CA1QGpmJorNbnMxK4KQJQJTFQqsKwiW/PntWN7AcZZG ZcTJ68o/UaNltZFH2OFeOiOGc9yYeIZRcYPCqjBpIS2RIgOJYSgh4REopZRapAuP8DO6 O9d6RPK8Ca+t72I+jcSuiEG6kKWZEzrYZiCrNV9KlmTu9qFvdQVYwj4j0b83dPMbE0fj vKUg== X-Received: by 10.52.31.103 with SMTP id z7mr22209352vdh.56.1364452744828; Wed, 27 Mar 2013 23:39:04 -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 cg12csp1433ved; Wed, 27 Mar 2013 23:39:04 -0700 (PDT) X-Received: by 10.68.190.99 with SMTP id gp3mr34178868pbc.117.1364452743920; Wed, 27 Mar 2013 23:39:03 -0700 (PDT) Received: from mail-pb0-f45.google.com (mail-pb0-f45.google.com [209.85.160.45]) by mx.google.com with ESMTPS id ui2si25446268pab.320.2013.03.27.23.39.03 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Mar 2013 23:39:03 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.45 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.45; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.45 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-f45.google.com with SMTP id ro8so5656292pbb.18 for ; Wed, 27 Mar 2013 23:39:03 -0700 (PDT) X-Received: by 10.66.232.230 with SMTP id tr6mr35051539pac.83.1364452743383; Wed, 27 Mar 2013 23:39:03 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id ce16sm26483940pac.5.2013.03.27.23.39.01 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 27 Mar 2013 23:39:03 -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 2/2] extcon: max8997: Fix return value Date: Thu, 28 Mar 2013 11:57:33 +0530 Message-Id: <1364452053-17405-2-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1364452053-17405-1-git-send-email-sachin.kamat@linaro.org> References: <1364452053-17405-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQm51NLKy7icefNGA34bG0r+hoN9miwYNkODt11wYnmNgoSxn/UYyUxkGHXAPMpFnXqXW7Xl Return the value obtained from the function instead of hardcoding. Fixes the following warnings: drivers/extcon/extcon-max8997.c:235 max8997_muic_set_path() info: why not propagate 'ret' from max8997_update_reg() instead of (-11)? drivers/extcon/extcon-max8997.c:248 max8997_muic_set_path() info: why not propagate 'ret' from max8997_update_reg() instead of (-11)? Signed-off-by: Sachin Kamat --- drivers/extcon/extcon-max8997.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c index 69641bc..3c593e8 100644 --- a/drivers/extcon/extcon-max8997.c +++ b/drivers/extcon/extcon-max8997.c @@ -196,7 +196,7 @@ static int max8997_muic_set_debounce_time(struct max8997_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: @@ -232,7 +232,7 @@ static int max8997_muic_set_path(struct max8997_muic_info *info, MAX8997_MUIC_REG_CONTROL1, ctrl1, COMP_SW_MASK); if (ret < 0) { dev_err(info->dev, "failed to update MUIC register\n"); - return -EAGAIN; + return ret; } if (attached) @@ -245,7 +245,7 @@ static int max8997_muic_set_path(struct max8997_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, @@ -397,7 +397,7 @@ static int max8997_muic_handle_jig_uart(struct max8997_muic_info *info, ret = max8997_muic_set_path(info, info->path_uart, attached); if (ret) { dev_err(info->dev, "failed to update muic register\n"); - return -EINVAL; + return ret; } extcon_set_cable_state(info->edev, "JIG", attached); @@ -608,7 +608,7 @@ static int max8997_muic_detect_dev(struct max8997_muic_info *info) if (ret) { dev_err(info->dev, "failed to read MUIC register\n"); mutex_unlock(&info->mutex); - return -EINVAL; + return ret; } adc = max8997_muic_get_cable_type(info, MAX8997_CABLE_GROUP_ADC,