devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhangfei Gao <zhangfei.gao@linaro.org>
To: Wolfram Sang <wsa@the-dreams.de>,
	Dirk Brandewie <dirk.brandewie@gmail.com>,
	baruch@tkos.co.il
Cc: Zhangfei Gao <zhangfei.gao@linaro.org>,
	devicetree-discuss@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/2] i2c: designware: use module_platform_driver
Date: Mon, 10 Jun 2013 13:02:54 +0800	[thread overview]
Message-ID: <1370840576-15651-2-git-send-email-zhangfei.gao@linaro.org> (raw)
In-Reply-To: <1370840576-15651-1-git-send-email-zhangfei.gao@linaro.org>

Instead of use platform_driver_probe, use module_platform_driver
To support deferred probing
Also subsys_initcall may too early to auto set pinctl

Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
CC: Baruch Siach <baruch@tkos.co.il>
---
 drivers/i2c/busses/i2c-designware-platdrv.c |   14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 35b70a1..41659c0 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -231,6 +231,7 @@ static SIMPLE_DEV_PM_OPS(dw_i2c_dev_pm_ops, dw_i2c_suspend, dw_i2c_resume);
 MODULE_ALIAS("platform:i2c_designware");
 
 static struct platform_driver dw_i2c_driver = {
+	.probe		= dw_i2c_probe,
 	.remove		= dw_i2c_remove,
 	.driver		= {
 		.name	= "i2c_designware",
@@ -240,18 +241,7 @@ static struct platform_driver dw_i2c_driver = {
 		.pm	= &dw_i2c_dev_pm_ops,
 	},
 };
-
-static int __init dw_i2c_init_driver(void)
-{
-	return platform_driver_probe(&dw_i2c_driver, dw_i2c_probe);
-}
-subsys_initcall(dw_i2c_init_driver);
-
-static void __exit dw_i2c_exit_driver(void)
-{
-	platform_driver_unregister(&dw_i2c_driver);
-}
-module_exit(dw_i2c_exit_driver);
+module_platform_driver(dw_i2c_driver);
 
 MODULE_AUTHOR("Baruch Siach <baruch@tkos.co.il>");
 MODULE_DESCRIPTION("Synopsys DesignWare I2C bus adapter");
-- 
1.7.9.5

  reply	other threads:[~2013-06-10  5:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-10  5:02 [PATCH v2 0/2] support hisilicon i2c Zhangfei Gao
2013-06-10  5:02 ` Zhangfei Gao [this message]
2013-06-10  5:02 ` [PATCH v2 2/2] i2c: designware: add two optional property tx/rx-fifo-size Zhangfei Gao
     [not found]   ` <1370840576-15651-3-git-send-email-zhangfei.gao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-06-10 18:49     ` Baruch Siach
2013-06-11  2:13       ` zhangfei
2013-06-11  2:30         ` [PATCH " Zhangfei Gao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1370840576-15651-2-git-send-email-zhangfei.gao@linaro.org \
    --to=zhangfei.gao@linaro.org \
    --cc=baruch@tkos.co.il \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=dirk.brandewie@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).