[PATCH 3/3] regulator: core: Disable unused regulators after deferred probing is done

From: Saravana Kannan
Date: Thu May 09 2013 - 01:19:41 EST


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 <skannan@xxxxxxxxxxxxxx>
---
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(&regulator_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);
--
1.7.8.3

The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/