From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932663AbbI3TbK (ORCPT ); Wed, 30 Sep 2015 15:31:10 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:59605 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753567AbbI3TbH (ORCPT ); Wed, 30 Sep 2015 15:31:07 -0400 From: Mark Brown To: Sascha Hauer , Liam Girdwood Cc: linux-kernel@vger.kernel.org, Mark Brown Date: Wed, 30 Sep 2015 20:30:52 +0100 Message-Id: <1443641452-21824-1-git-send-email-broonie@kernel.org> X-Mailer: git-send-email 2.5.0 X-SA-Exim-Connect-IP: 2a01:348:6:8808:7e7a:91ff:fede:4a45 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: [PATCH] regulator: core: Handle probe deferral from DT 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 regulator-regulator supplies we ignore probe deferral returns from regulator_dev_lookup() (such as are generated for DT when we can see a supply is registered) and just fall back to the dummy regulator if there are full constraints (as is the case for DT). This means that probe deferral is broken for DT systems, fix that by paying attention to -EPROBE_DEFER return codes like we do -ENODEV. A further patch will simplify this further, this is a minimal fix for the specific issue. Reported-by: Sascha Hauer Signed-off-by: Mark Brown --- Tested with my famous "I need to leave the house right now so haven't even tried building this yet" test plan - please let me know how this works for you. drivers/regulator/core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index af045e5..e9b94d7 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1448,6 +1448,10 @@ static int regulator_resolve_supply(struct regulator_dev *rdev) return 0; } + /* Did the lookup explicitly defer for us? */ + if (ret == -EPROBE_DEFER) + return ret; + if (have_full_constraints()) { r = dummy_regulator_rdev; get_device(&r->dev); -- 2.5.0