regulators: max77693: register driver earlier to avoid deferred probe
authorMarek Szyprowski <m.szyprowski@samsung.com>
Fri, 21 Aug 2015 12:38:39 +0000 (14:38 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 21 Aug 2015 16:07:45 +0000 (09:07 -0700)
MAX77693 based regulators are used by USB gadget subsystem, which
doesn't support deferred probe, so the driver should be registered
before USB gadget drivers get probed.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/max77693.c

index 788379b87962e297e653d616f6559dc4275ec36f..de730fd3f8a5df6cf7786be8f8b64c52b3786820 100644 (file)
@@ -300,7 +300,17 @@ static struct platform_driver max77693_pmic_driver = {
        .id_table = max77693_pmic_id,
 };
 
-module_platform_driver(max77693_pmic_driver);
+static int __init max77693_pmic_init(void)
+{
+       return platform_driver_register(&max77693_pmic_driver);
+}
+subsys_initcall(max77693_pmic_init);
+
+static void __exit max77693_pmic_cleanup(void)
+{
+       platform_driver_unregister(&max77693_pmic_driver);
+}
+module_exit(max77693_pmic_cleanup);
 
 MODULE_DESCRIPTION("MAXIM 77693/77843 regulator driver");
 MODULE_AUTHOR("Jonghwa Lee <jonghwa3.lee@samsung.com>");