From patchwork Tue Feb 18 10:41:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 24824 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 961E0203C5 for ; Tue, 18 Feb 2014 10:47:18 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id le5sf32567547vcb.7 for ; Tue, 18 Feb 2014 02:47:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=SDJdn48bB0RR7y1K2TyAwZ1M7i0ZvfOsl7tCbWY7/jQ=; b=OY7pNbacf7yuOoOu3cyDEXOEWjtCfDkAnw6KmNj4OVL3E0agGcVYtcCjwTvyXH+Rth iYdgX0SmofRlKVA1tij6Rw7GTL3h4UJR4LHKB0QeE3Q4+IRCVzBXaBoHyKtllzfIFAY1 N5P5HuzHXWET3CVY2QAprKwcqLRZgrmd2qRJGhi20GcvbQPFqXlt1HHbn+BHwrLTQkV5 USI8YcULua0rk2wWEF7cSyX5Qd6HBAzyOl1UNbWEWBqYGsubCLa3PGTSiXr9Ti0ttwvU e62OGKS5+1wPy6KfKi6i6etW+qrNnAPn/smVNtJHMwXHoVwsL3ey0+cUahuwTZNe1o8L 37mg== X-Gm-Message-State: ALoCoQm2cOVKqjI8lVdOjeEkEcN0mfMPy90qo3dcRC0sEDYdGyvYLeW4kuTXY38gbgzY5xKj6ced X-Received: by 10.236.190.199 with SMTP id e47mr8833735yhn.53.1392720438223; Tue, 18 Feb 2014 02:47:18 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.34.76 with SMTP id k70ls1312554qgk.30.gmail; Tue, 18 Feb 2014 02:47:18 -0800 (PST) X-Received: by 10.52.107.35 with SMTP id gz3mr17203775vdb.8.1392720438134; Tue, 18 Feb 2014 02:47:18 -0800 (PST) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id fb12si5389319veb.14.2014.02.18.02.47.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Feb 2014 02:47:18 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id pa12so13522511veb.30 for ; Tue, 18 Feb 2014 02:47:18 -0800 (PST) X-Received: by 10.52.246.42 with SMTP id xt10mr17203731vdc.9.1392720438007; Tue, 18 Feb 2014 02:47:18 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp207197vcz; Tue, 18 Feb 2014 02:47:17 -0800 (PST) X-Received: by 10.68.133.163 with SMTP id pd3mr3260048pbb.166.1392720437208; Tue, 18 Feb 2014 02:47:17 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wm3si17866986pab.252.2014.02.18.02.47.16; Tue, 18 Feb 2014 02:47:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755101AbaBRKrL (ORCPT + 27 others); Tue, 18 Feb 2014 05:47:11 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:64192 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754981AbaBRKrJ (ORCPT ); Tue, 18 Feb 2014 05:47:09 -0500 Received: by mail-pa0-f52.google.com with SMTP id bj1so16505493pad.25 for ; Tue, 18 Feb 2014 02:47:09 -0800 (PST) X-Received: by 10.68.249.100 with SMTP id yt4mr8989045pbc.165.1392720429398; Tue, 18 Feb 2014 02:47:09 -0800 (PST) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id gj9sm5442084pbc.7.2014.02.18.02.47.06 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Feb 2014 02:47:08 -0800 (PST) From: Sachin Kamat To: linux-kernel@vger.kernel.org Cc: broonie@kernel.org, lgirdwood@gmail.com, sachin.kamat@linaro.org Subject: [PATCH 09/15] regulator: da9063: Do not hardcode return values Date: Tue, 18 Feb 2014 16:11:05 +0530 Message-Id: <1392720071-13503-9-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1392720071-13503-1-git-send-email-sachin.kamat@linaro.org> References: <1392720071-13503-1-git-send-email-sachin.kamat@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sachin.kamat@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Propagate the error values returned by the function instead. Signed-off-by: Sachin Kamat --- drivers/regulator/da9063-regulator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/da9063-regulator.c b/drivers/regulator/da9063-regulator.c index a61b5d997a08..22ba992e73f2 100644 --- a/drivers/regulator/da9063-regulator.c +++ b/drivers/regulator/da9063-regulator.c @@ -365,7 +365,7 @@ static int da9063_set_suspend_voltage(struct regulator_dev *rdev, int uV) sel = regulator_map_voltage_linear(rdev, uV, uV); if (sel < 0) - return -EINVAL; + return sel; sel <<= ffs(rdev->desc->vsel_mask) - 1; @@ -757,7 +757,7 @@ static int da9063_regulator_probe(struct platform_device *pdev) if (ret < 0) { dev_err(&pdev->dev, "Error while reading BUCKs configuration\n"); - return -EIO; + return ret; } bcores_merged = val & DA9063_BCORE_MERGE; bmem_bio_merged = val & DA9063_BUCK_MERGE;