From patchwork Tue Feb 25 01:34:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 3712501 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8E8489F2F7 for ; Tue, 25 Feb 2014 01:35:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C41D32015A for ; Tue, 25 Feb 2014 01:35:18 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 865A2200DF for ; Tue, 25 Feb 2014 01:35:17 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WI6vK-0006ON-E1; Tue, 25 Feb 2014 01:35:06 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WI6vI-0000VS-0J; Tue, 25 Feb 2014 01:35:04 +0000 Received: from mezzanine.sirena.org.uk ([2400:8900::f03c:91ff:fedb:4f4]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WI6vF-0000T8-7F for linux-arm-kernel@lists.infradead.org; Tue, 25 Feb 2014 01:35:02 +0000 Received: from [121.174.50.227] (helo=finisterre) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1WI6ue-00052z-QG; Tue, 25 Feb 2014 01:34:25 +0000 Received: from broonie by finisterre with local (Exim 4.82) (envelope-from ) id 1WI6ue-0007QH-6p; Tue, 25 Feb 2014 10:34:24 +0900 Date: Tue, 25 Feb 2014 10:34:24 +0900 From: Mark Brown To: Markus Pargmann Message-ID: <20140225013424.GL25940@sirena.org.uk> References: <1392914164-28596-1-git-send-email-mpa@pengutronix.de> <20140223051209.GK25940@sirena.org.uk> <20140224205058.GA18317@pengutronix.de> MIME-Version: 1.0 In-Reply-To: <20140224205058.GA18317@pengutronix.de> X-Cookie: You're at the end of the road again. User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 121.174.50.227 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Subject: Re: [PATCH v3 0/2] regulator: core: Fix ops->enable/disable usage X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140224_203501_630668_88B4D124 X-CRM114-Status: GOOD ( 21.72 ) X-Spam-Score: -1.9 (-) Cc: "linux-arm-kernel@lists.infradead.org" , Fabio Estevam , Liam Girdwood , Sascha Hauer , linux-kernel X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Feb 24, 2014 at 09:50:58PM +0100, Markus Pargmann wrote: > The only situation where this returns -EINVAL is a dummy regulator that > is not always_on. As it doesn't make sense to have a dummy regulator > that is not always_on, I will add a check for exactly this situation to > the regulator_register function and drop the "return -EINVAL" above. I've squashed the following fix in today: From 937635aa9c667b90b76505de91c5693da6a5c120 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Tue, 25 Feb 2014 10:24:55 +0900 Subject: [PATCH] regulator: Handle invalid enable operation for always/boot on regulators Signed-off-by: Mark Brown --- drivers/regulator/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 8cbc7d7..9a09f3c 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1017,7 +1017,7 @@ static int set_machine_constraints(struct regulator_dev *rdev, */ if (rdev->constraints->always_on || rdev->constraints->boot_on) { ret = _regulator_do_enable(rdev); - if (ret < 0) { + if (ret < 0 && ret != -EINVAL) { rdev_err(rdev, "failed to enable\n"); goto out; }