diff options
author | Andrew-CT Chen <andrew-ct.chen@mediatek.com> | 2016-02-22 11:24:05 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-05 12:20:29 -0800 |
commit | 564e7f87a0806462898bf67112bc602644476c56 (patch) | |
tree | 90effe95f059eb0c64e9a5310185df73b4ad0064 /drivers/nvmem | |
parent | c7e3c5f861f0406aa4bc7ee4af0d789ef4a828db (diff) | |
download | linux-stable-564e7f87a0806462898bf67112bc602644476c56.tar.gz linux-stable-564e7f87a0806462898bf67112bc602644476c56.tar.bz2 linux-stable-564e7f87a0806462898bf67112bc602644476c56.zip |
nvmem: mediatek: Fix later provider initialization
Possibly, provider driver initialization is later than
consumer driver. Use function subsys_initcall to initialize
NVMEM provider early to ensure NVMEM consumer doesn't need
to -EPROBE_DEFER.
Signed-off-by: Andrew-CT Chen <andrew-ct.chen@mediatek.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/nvmem')
-rw-r--r-- | drivers/nvmem/mtk-efuse.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/nvmem/mtk-efuse.c b/drivers/nvmem/mtk-efuse.c index 7b35f5b630cd..9c49369beea5 100644 --- a/drivers/nvmem/mtk-efuse.c +++ b/drivers/nvmem/mtk-efuse.c @@ -83,7 +83,28 @@ static struct platform_driver mtk_efuse_driver = { .of_match_table = mtk_efuse_of_match, }, }; -module_platform_driver(mtk_efuse_driver); + +static int __init mtk_efuse_init(void) +{ + int ret; + + ret = platform_driver_register(&mtk_efuse_driver); + if (ret) { + pr_err("Failed to register efuse driver\n"); + return ret; + } + + return 0; +} + +static void __exit mtk_efuse_exit(void) +{ + return platform_driver_unregister(&mtk_efuse_driver); +} + +subsys_initcall(mtk_efuse_init); +module_exit(mtk_efuse_exit); + MODULE_AUTHOR("Andrew-CT Chen <andrew-ct.chen@mediatek.com>"); MODULE_DESCRIPTION("Mediatek EFUSE driver"); MODULE_LICENSE("GPL v2"); |