From patchwork Thu May 9 05:18:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravana Kannan X-Patchwork-Id: 2543071 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id 505B53FD4E for ; Thu, 9 May 2013 05:20:36 +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 1UaJGp-0001Sb-91; Thu, 09 May 2013 05:19:59 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UaJGW-0007OS-Hp; Thu, 09 May 2013 05:19:40 +0000 Received: from wolverine02.qualcomm.com ([199.106.114.251]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UaJGT-0007MC-8F for linux-arm-kernel@lists.infradead.org; Thu, 09 May 2013 05:19:38 +0000 X-IronPort-AV: E=Sophos;i="4.87,638,1363158000"; d="scan'208";a="45617295" Received: from pdmz-ns-mip.qualcomm.com (HELO mostmsg01.qualcomm.com) ([199.106.114.10]) by wolverine02.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 08 May 2013 22:18:52 -0700 Received: from skannan1-linux.qualcomm.com (pdmz-ns-snip_218_1.qualcomm.com [192.168.218.1]) by mostmsg01.qualcomm.com (Postfix) with ESMTPA id 86D0C10004D6; Wed, 8 May 2013 22:18:52 -0700 (PDT) From: Saravana Kannan To: Greg Kroah-Hartman , Grant Likely , Mike Turquette , Liam Girdwood , Mark Brown Subject: [PATCH 3/3] regulator: core: Disable unused regulators after deferred probing is done Date: Wed, 8 May 2013 22:18:46 -0700 Message-Id: <1368076726-11492-4-git-send-email-skannan@codeaurora.org> X-Mailer: git-send-email 1.7.8.3 In-Reply-To: <1368076726-11492-1-git-send-email-skannan@codeaurora.org> References: <1368076726-11492-1-git-send-email-skannan@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130509_011937_484089_0D49BAEF X-CRM114-Status: GOOD ( 11.23 ) X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [199.106.114.251 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-arm-msm@vger.kernel.org, Stephen Boyd , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org With deferred probing, late_initcall() is too soon to declare a regulator as unused. Wait for deferred probing to finish before declaring a regulator as unused. Signed-off-by: Saravana Kannan --- drivers/regulator/core.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index e3661c2..11a0508 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -3812,6 +3812,8 @@ static int __init regulator_init_complete(void) if (of_have_populated_dt()) has_full_constraints = true; + wait_for_init_deferred_probe_done(); + mutex_lock(®ulator_list_mutex); /* If we have a full configuration then disable any regulators @@ -3864,4 +3866,4 @@ unlock: return 0; } -late_initcall(regulator_init_complete); +late_initcall_sync(regulator_init_complete);