linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: sirf: move driver init from module_init to subsys_initcall
@ 2013-05-16  2:50 Barry Song
       [not found] ` <1368672607-5536-1-git-send-email-Baohua.Song-kQvG35nSl+M@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Barry Song @ 2013-05-16  2:50 UTC (permalink / raw)
  To: wsa, linux-i2c
  Cc: Barry Song, workgroup.linux, linux-arm-kernel, Xiaomeng Hou

From: Xiaomeng Hou <Xiaomeng.Hou@csr.com>

if we initilize i2c bus by module_init, there are some devices which want
initialization earlier than i2c and could not do that in time, so move i2c
driver initilization to subsys_initcall and make i2c ready before devices
init.

Signed-off-by: Xiaomeng Hou <Xiaomeng.Hou@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
---
 drivers/i2c/busses/i2c-sirf.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-sirf.c b/drivers/i2c/busses/i2c-sirf.c
index 5a7ad24..e438f48 100644
--- a/drivers/i2c/busses/i2c-sirf.c
+++ b/drivers/i2c/busses/i2c-sirf.c
@@ -454,7 +454,19 @@ static struct platform_driver i2c_sirfsoc_driver = {
 	.probe = i2c_sirfsoc_probe,
 	.remove = i2c_sirfsoc_remove,
 };
-module_platform_driver(i2c_sirfsoc_driver);
+
+static __init int i2c_sirfsoc_init(void)
+{
+	return platform_driver_register(&i2c_sirfsoc_driver);
+}
+
+static void __exit i2c_sirfsoc_exit(void)
+{
+	platform_driver_unregister(&i2c_sirfsoc_driver);
+}
+
+subsys_initcall(i2c_sirfsoc_init);
+module_exit(i2c_sirfsoc_exit);
 
 MODULE_DESCRIPTION("SiRF SoC I2C master controller driver");
 MODULE_AUTHOR("Zhiwu Song <Zhiwu.Song@csr.com>, "
-- 
1.8.2.3



Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-06-11 12:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-16  2:50 [PATCH] i2c: sirf: move driver init from module_init to subsys_initcall Barry Song
     [not found] ` <1368672607-5536-1-git-send-email-Baohua.Song-kQvG35nSl+M@public.gmane.org>
2013-05-16  9:38   ` Wolfram Sang
2013-05-16 10:25     ` Barry Song
     [not found]       ` <CAGsJ_4zVOF8-g=emEGgP3atxkWdxMaQQiVZrZkht_WueTriSnw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-05-25 20:10         ` Mark Brown
     [not found]           ` <20130525201032.GD32043-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-05-27  1:54             ` Barry Song
     [not found]               ` <CAGsJ_4y6SY6nNkbW+Yh8jx0WB4Pi9MO1W3xVZcrQcedGeD5ogQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-05-27 12:16                 ` Mark Brown
     [not found]                   ` <20130527121658.GA3660-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-05-27 15:36                     ` Barry Song
     [not found]                       ` <CAGsJ_4w867BhFvVze5BNaYheW75pMcOGhscz3wSZiia-neP59w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-06-10 13:45                         ` Wolfram Sang
2013-06-11  1:14                           ` Barry Song
     [not found]                             ` <CAGsJ_4y4svi0TbUKK1aAW1McM5rFoo5Vb9rGPweq-sHJ2NN5cQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-06-11  8:48                               ` Mark Brown
     [not found]                                 ` <20130611084827.GS1403-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-06-11 11:13                                   ` Barry Song
     [not found]                                     ` <CAGsJ_4wH=mNxBTqizKjJR2YhmVQa=iprfUmVYy8oz7MZeLfkqg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-06-11 12:10                                       ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).