mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Boyd <stephen.boyd@linaro.org>
To: Mark Brown <broonie@kernel.org>
Cc: linux-arm@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org
Subject: [PATCH 2/2] regulator: qcom_spmi: Keep trying to add regulators if read fails
Date: Fri, 25 Mar 2016 14:35:09 -0700	[thread overview]
Message-ID: <1458941709-5386-3-git-send-email-stephen.boyd@linaro.org> (raw)
In-Reply-To: <1458941709-5386-1-git-send-email-stephen.boyd@linaro.org>

On some designs, a handful of the regulators can't be read via
SPMI transactions because they're "secure" and not intended to be
touched by non-secure processors. This driver unconditionally
attempts to read the id registers of all the regulators though,
leading to probe failing and no regulators being registered.
Let's ignore any errors from failing to read the registers and
keep adding other regulators so that this driver can probe on
such devices.

Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
---
 drivers/regulator/qcom_spmi-regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/qcom_spmi-regulator.c b/drivers/regulator/qcom_spmi-regulator.c
index 07689fd0c0b0..3550f7f7c2eb 100644
--- a/drivers/regulator/qcom_spmi-regulator.c
+++ b/drivers/regulator/qcom_spmi-regulator.c
@@ -1201,7 +1201,7 @@ static int spmi_regulator_match(struct spmi_regulator *vreg, u16 force_type)
 	ret = spmi_vreg_read(vreg, SPMI_COMMON_REG_DIG_MAJOR_REV, version,
 		ARRAY_SIZE(version));
 	if (ret) {
-		dev_err(vreg->dev, "could not read version registers\n");
+		dev_dbg(vreg->dev, "could not read version registers\n");
 		return ret;
 	}
 	dig_major_rev	= version[SPMI_COMMON_REG_DIG_MAJOR_REV
@@ -1624,7 +1624,7 @@ static int qcom_spmi_regulator_probe(struct platform_device *pdev)
 
 		ret = spmi_regulator_match(vreg, reg->force_type);
 		if (ret)
-			goto err;
+			continue;
 
 		config.dev = dev;
 		config.driver_data = vreg;
-- 
2.8.0.rc4

      parent reply	other threads:[~2016-03-25 21:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-25 21:35 [PATCH 0/2] Support qcom pm8994 regulators Stephen Boyd
2016-03-25 21:35 ` [PATCH 1/2] regulator: qcom_spmi: Add support for pm8994 Stephen Boyd
2016-03-25 21:35 ` Stephen Boyd [this message]

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=1458941709-5386-3-git-send-email-stephen.boyd@linaro.org \
    --to=stephen.boyd@linaro.org \
    --cc=broonie@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-arm@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®