From: He YunLei <heyunlei@huawei.com>
To: <linux-kernel@vger.kernel.org>
Cc: <grant.likely@linaro.org>, <robh+dt@kernel.org>,
<wangbintian@huawei.com>, <tony@atomide.com>,
<liguozhu@hisilicon.com>, <kong.kongxinwei@hisilicon.com>
Subject: [RFC PATCH] pinctrl: pinctrl-single.c: init pinctrl single at arch_initcall time
Date: Mon, 29 Sep 2014 18:31:16 +0800 [thread overview]
Message-ID: <542934F4.10303@huawei.com> (raw)
On our arm platform, some modules (e.g. I2C bus driver) will use the
pinctrl-single driver to configure the SoC pin, but pinctrl-single
driver uses module_init time, that makes some modules initialize ahead
the pinctrl-single and fail to register.
This patch promotes the initialization priority of pinctrl-single from
module_init time to arch_initcall time.
Signed-off-by: Yunlei He <heyunlei@huawei.com>
Signed-off-by: Xinwei Kong <kong.kongxinwei@hisilicon.com>
---
drivers/pinctrl/pinctrl-single.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-single.c
b/drivers/pinctrl/pinctrl-single.c
index 95dd9cf..4b9e5b9 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -2012,7 +2012,18 @@ static struct platform_driver pcs_driver = {
#endif
};
-module_platform_driver(pcs_driver);
+static int __init pinctrl_single_init(void)
+{
+ return platform_driver_register(&pcs_driver);
+}
+
+static void __exit pinctrl_single_exit(void)
+{
+ platform_driver_unregister(&pcs_driver);
+}
+
+arch_initcall(pinctrl_single_init);
+module_exit(pinctrl_single_exit);
MODULE_AUTHOR("Tony Lindgren <tony@atomide.com>");
MODULE_DESCRIPTION("One-register-per-pin type device tree based
pinctrl driver");
--
1.7.9.5
next reply other threads:[~2014-09-29 10:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-29 10:31 He YunLei [this message]
2014-09-29 17:54 ` [RFC PATCH] pinctrl: pinctrl-single.c: init pinctrl single at arch_initcall time Tony Lindgren
2014-10-08 1:42 ` He YunLei
2014-10-08 18:10 ` Tony Lindgren
2014-10-11 9:01 ` He YunLei
2014-10-13 15:42 ` Tony Lindgren
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=542934F4.10303@huawei.com \
--to=heyunlei@huawei.com \
--cc=grant.likely@linaro.org \
--cc=kong.kongxinwei@hisilicon.com \
--cc=liguozhu@hisilicon.com \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=tony@atomide.com \
--cc=wangbintian@huawei.com \
/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).