From patchwork Tue Feb 18 10:41:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 24831 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f71.google.com (mail-pb0-f71.google.com [209.85.160.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 719E5203C5 for ; Tue, 18 Feb 2014 10:49:34 +0000 (UTC) Received: by mail-pb0-f71.google.com with SMTP id jt11sf38335125pbb.6 for ; Tue, 18 Feb 2014 02:49:33 -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=LQzuh56FJ+Y0/U/T7zzYzY202p2qbuwqtrmjzucdU0E=; b=h8fN15SG9K1IxheqCa8DcI+dnI6BOs5M5ERZ91slu723hI9cgMT7/blMqRIqS1tsfJ w/eAmLaWYHU8hkKcsWR/G12gkNGBqX0HIUeLJSwNhwN+ZxPAozXakal5AlYFWXWCedKx Fct36sS3YepTuWJwXtaas2TyN7mj09r8fYBXBj/JJ+QSd+Pc+KOjbtNgf4z4WHJMP4FJ HMs7QNPqZ4sTwqk7Jd4MR6TEbTez2UGK2UJLoRfphziQ34MGF+U5hOfyJIA1asZei9UD QDNSmVGoHEmHZoobiOjL1AU8JeeC9X4XgQBhem0e4nOdXQc8UXgngJ/dVN+V80lvZH+g ix9w== X-Gm-Message-State: ALoCoQkSb/yk4qSa0lZ/C47IipYFvckFGwm6xVPbDTYOAYyOBMkQEJ6zGwDA+EpYS4OIrcnMwZtL X-Received: by 10.66.150.106 with SMTP id uh10mr12366896pab.13.1392720573386; Tue, 18 Feb 2014 02:49:33 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.27.239 with SMTP id 102ls1189901qgx.23.gmail; Tue, 18 Feb 2014 02:49:33 -0800 (PST) X-Received: by 10.220.10.2 with SMTP id n2mr16177484vcn.26.1392720573236; Tue, 18 Feb 2014 02:49:33 -0800 (PST) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id sq4si5381107vdc.2.2014.02.18.02.49.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Feb 2014 02:49:33 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id ks9so12532808vcb.25 for ; Tue, 18 Feb 2014 02:49:33 -0800 (PST) X-Received: by 10.220.106.84 with SMTP id w20mr20691953vco.18.1392720573162; Tue, 18 Feb 2014 02:49:33 -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 u4csp207312vcz; Tue, 18 Feb 2014 02:49:32 -0800 (PST) X-Received: by 10.68.201.163 with SMTP id kb3mr2762327pbc.168.1392720572377; Tue, 18 Feb 2014 02:49:32 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ez5si17918544pab.19.2014.02.18.02.49.30; Tue, 18 Feb 2014 02:49:30 -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 S1755304AbaBRKtW (ORCPT + 27 others); Tue, 18 Feb 2014 05:49:22 -0500 Received: from mail-pb0-f46.google.com ([209.85.160.46]:47032 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754858AbaBRKrG (ORCPT ); Tue, 18 Feb 2014 05:47:06 -0500 Received: by mail-pb0-f46.google.com with SMTP id um1so16522816pbc.19 for ; Tue, 18 Feb 2014 02:47:06 -0800 (PST) X-Received: by 10.68.66.33 with SMTP id c1mr32491573pbt.118.1392720426499; Tue, 18 Feb 2014 02:47:06 -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.03 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Feb 2014 02:47:05 -0800 (PST) From: Sachin Kamat To: linux-kernel@vger.kernel.org Cc: broonie@kernel.org, lgirdwood@gmail.com, sachin.kamat@linaro.org Subject: [PATCH 08/15] regulator: fan53555: Do not hardcode return values Date: Tue, 18 Feb 2014 16:11:04 +0530 Message-Id: <1392720071-13503-8-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.220.180 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/fan53555.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c index 7ca3d9e3b0fe..a10df7d150cc 100644 --- a/drivers/regulator/fan53555.c +++ b/drivers/regulator/fan53555.c @@ -90,11 +90,11 @@ static int fan53555_set_suspend_voltage(struct regulator_dev *rdev, int uV) return 0; ret = regulator_map_voltage_linear(rdev, uV, uV); if (ret < 0) - return -EINVAL; + return ret; ret = regmap_update_bits(di->regmap, di->sleep_reg, VSEL_NSEL_MASK, ret); if (ret < 0) - return -EINVAL; + return ret; /* Cache the sleep voltage setting. * Might not be the real voltage which is rounded */ di->sleep_vol_cache = uV; @@ -260,14 +260,14 @@ static int fan53555_regulator_probe(struct i2c_client *client, ret = regmap_read(di->regmap, FAN53555_ID1, &val); if (ret < 0) { dev_err(&client->dev, "Failed to get chip ID!\n"); - return -ENODEV; + return ret; } di->chip_id = val & DIE_ID; /* Get chip revision */ ret = regmap_read(di->regmap, FAN53555_ID2, &val); if (ret < 0) { dev_err(&client->dev, "Failed to get chip Rev!\n"); - return -ENODEV; + return ret; } di->chip_rev = val & DIE_REV; dev_info(&client->dev, "FAN53555 Option[%d] Rev[%d] Detected!\n",