mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: linux-kernel@vger.kernel.org,
	Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH 6/6] regulator: Ensure val is initialised in 88pm8607 choose_voltage()
Date: Thu, 22 Oct 2009 16:31:35 +0100	[thread overview]
Message-ID: <1256225495-15379-6-git-send-email-broonie@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1256225495-15379-1-git-send-email-broonie@opensource.wolfsonmicro.com>

If we fall through it means that we hit an unknown regulator/chip
combination so set -ENOENT as an explicit flag (the return code
is only used internally).

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/regulator/88pm8607.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/regulator/88pm8607.c b/drivers/regulator/88pm8607.c
index e1aabda..0471955 100644
--- a/drivers/regulator/88pm8607.c
+++ b/drivers/regulator/88pm8607.c
@@ -170,7 +170,8 @@ static int choose_voltage(struct regulator_dev *rdev, int min_uV, int max_uV)
 {
 	struct pm8607_regulator_info *info = rdev_get_drvdata(rdev);
 	uint8_t chip_id = info->chip->chip_id;
-	int val, ret;
+	int val = -ENOENT;
+	int ret;
 
 	switch (info->desc.id) {
 	case PM8607_ID_BUCK1:
-- 
1.6.5


  parent reply	other threads:[~2009-10-22 15:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-22 15:31 [PATCH 1/6] regulator: Also lift apply_uV into machine_constraints_voltage() Mark Brown
2009-10-22 15:31 ` [PATCH 2/6] regulator: Display actual settings with constraints Mark Brown
2009-10-22 15:31 ` [PATCH 3/6] regulator: Factor out regulator name pretty printing Mark Brown
2009-10-22 15:31 ` [PATCH 4/6] regulator: Handle regulators without suspend mode configuration Mark Brown
2009-10-22 15:31 ` [PATCH 5/6] regulator: Remove duplicate consts from ab3100 Mark Brown
2009-10-22 15:31 ` Mark Brown [this message]
2009-10-26 13:40 ` [PATCH 1/6] regulator: Also lift apply_uV into machine_constraints_voltage() Liam Girdwood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1256225495-15379-6-git-send-email-broonie@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome