From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753954AbbGNKS0 (ORCPT ); Tue, 14 Jul 2015 06:18:26 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:51152 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753662AbbGNKSZ (ORCPT ); Tue, 14 Jul 2015 06:18:25 -0400 From: Mark Brown To: Christian Hartmann Cc: linux-kernel@vger.kernel.org, Mark Brown Date: Tue, 14 Jul 2015 11:18:19 +0100 Message-Id: <1436869099-24418-1-git-send-email-broonie@kernel.org> X-Mailer: git-send-email 2.1.4 X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: [PATCH] regulator: core: Handle full constraints systems when resolving supplies 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) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When resolving device supplies if we fail to look up the regulator we substitute in the dummy supply instead if the system has fully specified constraints. When resolving supplies for regulators we do not have the equivalent code and instead just directly use the regulator_dev_lookup() result causing spurious failures. This does not affect DT systems since we are able to detect missing mappings directly as part of regulator_dev_lookup() and so have appropriate handling in the DT specific code. Reported-by: Christian Hartmann Signed-off-by: Mark Brown --- Compile tested only at this point. drivers/regulator/core.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index c9f72019bd68..bb8528dfad8c 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1381,9 +1381,13 @@ static int regulator_resolve_supply(struct regulator_dev *rdev) } if (!r) { - dev_err(dev, "Failed to resolve %s-supply for %s\n", - rdev->supply_name, rdev->desc->name); - return -EPROBE_DEFER; + if (have_full_constraints()) { + r = dummy_regulator_rdev; + } else { + dev_err(dev, "Failed to resolve %s-supply for %s\n", + rdev->supply_name, rdev->desc->name); + return -EPROBE_DEFER; + } } /* Recursively resolve the supply of the supply */ -- 2.1.4