regulator: stub: Export init function for early probe

Some usecases of stub-regulator require the regulator devices to
be probed early on. As a consequence, allow for stub-regulator
to be added at a custom time by the platform code. Simply
changing the init level of this driver is not enough. We must
allow for other drivers added at the same init level to be
dependencies or dependents of this driver.

Change-Id: Ifd57d0e77e25f73dfb16c45c6774a382873ec44a
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
diff --git a/drivers/regulator/stub-regulator.c b/drivers/regulator/stub-regulator.c
index 6198c40..1c4b935 100644
--- a/drivers/regulator/stub-regulator.c
+++ b/drivers/regulator/stub-regulator.c
@@ -215,11 +215,18 @@
 	},
 };
 
-static int __init regulator_stub_init(void)
+int __init regulator_stub_init(void)
 {
+	static int registered;
+
+	if (registered)
+		return 0;
+	else
+		registered = 1;
 	return platform_driver_register(&regulator_stub_driver);
 }
 postcore_initcall(regulator_stub_init);
+EXPORT_SYMBOL(regulator_stub_init);
 
 static void __exit regulator_stub_exit(void)
 {