mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexandre Courbot <acourbot@nvidia.com>
To: Mark Brown <broonie@linaro.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Markus Pargmann <mpa@pengutronix.de>
Cc: <linux-kernel@vger.kernel.org>, <gnurou@gmail.com>,
	Alexandre Courbot <acourbot@nvidia.com>
Subject: [PATCH] regulator: core: allow enabling without enable op
Date: Tue, 25 Feb 2014 15:57:50 +0900	[thread overview]
Message-ID: <1393311470-11526-1-git-send-email-acourbot@nvidia.com> (raw)

Commit 14c32a3ce6676265d7a27ea64a4d406e6dbad111 replaced direct uses of
ops->enable by calls to _regulator_do_enable. This prevents a fixed
regulators without a GPIO from being probed, since the former code
checked the existence of ops->enable and continued if it did not exist,
while _regulator_do_enable return -EINVAL in that case.

This patch fixes this by allowing _regulator_do_enable to go through
without error if ops->enable is not defined, similarly to what
_regulator_do_disable already does.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
 drivers/regulator/core.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index bdb12659dd41..4306422cee5d 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1763,8 +1763,6 @@ static int _regulator_do_enable(struct regulator_dev *rdev)
 		ret = rdev->desc->ops->enable(rdev);
 		if (ret < 0)
 			return ret;
-	} else {
-		return -EINVAL;
 	}
 
 	/* Allow the regulator to ramp; it would be useful to extend
-- 
1.9.0


             reply	other threads:[~2014-02-25  6:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-25  6:57 Alexandre Courbot [this message]
2014-02-25  9:43 ` Sachin Kamat

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=1393311470-11526-1-git-send-email-acourbot@nvidia.com \
    --to=acourbot@nvidia.com \
    --cc=broonie@linaro.org \
    --cc=gnurou@gmail.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpa@pengutronix.de \
    /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®