From patchwork Tue Feb 18 10:41:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 24832 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f70.google.com (mail-oa0-f70.google.com [209.85.219.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A440D203C5 for ; Tue, 18 Feb 2014 10:50:10 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id m1sf69036677oag.5 for ; Tue, 18 Feb 2014 02:50:09 -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=EIITOFiRwSPgEsR2Qu67hoEqFkyHfu1GYrmU/6N/Ly0=; b=AYoMQilQr63GRFNiDugH5eEUMvfIjhOrY0hA88rLHgkTyMJ2lCHrvla7X5mMoFJXiu 1mkZxcp7JlhhLkhNKpNlOWyzFCksCz4fpkZWKl3aFpTkMJaMkwhgUHuJTBDo9SHoYZ11 XH2DubgYKkkaHdcUaluH38uetXZNp76ds5EtbfArT14ekdct1tKp8rKGvM+CrrwNwJ9R lKXIUA7GYWt3D4qdytplwtqUJ1F+iKm32n9jhNctD34b38XzuL9Lo2m4UbZgF+XdYpes bxvjuvIHBFJpgPnGG+CdDSShBcsogmfiJTKw5vX/9zvesZ6/JFyuU9xPY6tlw3fcj8Ut 6zDA== X-Gm-Message-State: ALoCoQkZWBqfz8XQOHEeexZTN0qU2SkLH/FqK+mKwFPNYpWpE5rkl+Sbcsoj80l6FnvMeohDcdl9 X-Received: by 10.182.186.73 with SMTP id fi9mr12680837obc.48.1392720609655; Tue, 18 Feb 2014 02:50:09 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.41.202 with SMTP id z68ls1297438qgz.85.gmail; Tue, 18 Feb 2014 02:50:09 -0800 (PST) X-Received: by 10.52.89.230 with SMTP id br6mr17636535vdb.20.1392720609460; Tue, 18 Feb 2014 02:50:09 -0800 (PST) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id w5si5377819vcn.101.2014.02.18.02.50.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Feb 2014 02:50:09 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.175 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.175; Received: by mail-ve0-f175.google.com with SMTP id c14so13136374vea.20 for ; Tue, 18 Feb 2014 02:50:09 -0800 (PST) X-Received: by 10.220.247.68 with SMTP id mb4mr4873466vcb.37.1392720609382; Tue, 18 Feb 2014 02:50:09 -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 u4csp207344vcz; Tue, 18 Feb 2014 02:50:08 -0800 (PST) X-Received: by 10.68.227.4 with SMTP id rw4mr24205217pbc.3.1392720608553; Tue, 18 Feb 2014 02:50:08 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si17920024pbf.91.2014.02.18.02.50.07; Tue, 18 Feb 2014 02:50:07 -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 S1755330AbaBRKtt (ORCPT + 27 others); Tue, 18 Feb 2014 05:49:49 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:39154 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754875AbaBRKrA (ORCPT ); Tue, 18 Feb 2014 05:47:00 -0500 Received: by mail-pa0-f52.google.com with SMTP id bj1so16505351pad.25 for ; Tue, 18 Feb 2014 02:47:00 -0800 (PST) X-Received: by 10.66.141.231 with SMTP id rr7mr31649250pab.41.1392720420144; Tue, 18 Feb 2014 02:47:00 -0800 (PST) Received: from linaro.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPSA id gj9sm5442084pbc.7.2014.02.18.02.46.56 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Feb 2014 02:46:58 -0800 (PST) From: Sachin Kamat To: linux-kernel@vger.kernel.org Cc: broonie@kernel.org, lgirdwood@gmail.com, sachin.kamat@linaro.org Subject: [PATCH 06/15] regulator: lp872x: Do not hardcode return values Date: Tue, 18 Feb 2014 16:11:02 +0530 Message-Id: <1392720071-13503-6-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.175 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/lp872x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/lp872x.c b/drivers/regulator/lp872x.c index 2e4734ff79fc..2e022aabd951 100644 --- a/drivers/regulator/lp872x.c +++ b/drivers/regulator/lp872x.c @@ -211,7 +211,7 @@ static int lp872x_get_timestep_usec(struct lp872x *lp) ret = lp872x_read_byte(lp, LP872X_GENERAL_CFG, &val); if (ret) - return -EINVAL; + return ret; val = (val & mask) >> shift; if (val >= size) @@ -229,7 +229,7 @@ static int lp872x_regulator_enable_time(struct regulator_dev *rdev) u8 addr, val; if (time_step_us < 0) - return -EINVAL; + return time_step_us; switch (rid) { case LP8720_ID_LDO1 ... LP8720_ID_BUCK: