linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Maxime Ripard <maxime.ripard@free-electrons.com>,
	Chen-Yu Tsai <wens@csie.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Hans de Goede <hdegoede@redhat.com>
Subject: [PATCH 2/2] regulator: axp20x: Handle regulator_register returning ENODEV
Date: Wed, 27 Apr 2016 16:03:45 +0200	[thread overview]
Message-ID: <1461765825-15915-3-git-send-email-hdegoede@redhat.com> (raw)
In-Reply-To: <1461765825-15915-1-git-send-email-hdegoede@redhat.com>

Handle regulator_register returning ENODEV, this may happen when
the dts node for the regulator contains "status = disabled" which
is useful for the ldo_io regulators, to avoid the regulator code
getting in the way of gpio use of these pins.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/regulator/axp20x-regulator.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index 5ddaa82..500d162 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -423,6 +423,9 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
 
 		rdev = devm_regulator_register(&pdev->dev, desc, &config);
 		if (IS_ERR(rdev)) {
+			if (PTR_ERR(rdev) == -ENODEV)
+				continue;
+
 			dev_err(&pdev->dev, "Failed to register %s\n",
 				regulators[i].name);
 
-- 
2.7.4

  parent reply	other threads:[~2016-04-27 14:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-27 14:03 [PATCH resend 0/2] regulator: core: Allow use of "status = disabled" in regulator dts nodes Hans de Goede
2016-04-27 14:03 ` [PATCH 1/2] " Hans de Goede
2016-04-27 14:24   ` Mark Brown
2016-04-27 14:31     ` Hans de Goede
2016-04-27 14:37       ` Mark Brown
2016-04-27 14:40         ` Hans de Goede
2016-04-27 15:01           ` Mark Brown
2016-04-27 15:50             ` Maxime Ripard
2016-04-27 15:52               ` Hans de Goede
2016-04-27 15:54                 ` Hans de Goede
2016-04-27 16:32                   ` Mark Brown
2016-04-27 14:03 ` Hans de Goede [this message]
2016-04-27 14:25   ` [PATCH 2/2] regulator: axp20x: Handle regulator_register returning ENODEV Mark Brown

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=1461765825-15915-3-git-send-email-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    --cc=wens@csie.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;
as well as URLs for NNTP newsgroup(s).