From: Thierry Reding <thierry.reding@gmail.com>
To: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <rob.herring@calxeda.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Stephen Warren <swarren@wwwdotorg.org>,
Hiroshi Doyu <hdoyu@nvidia.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [RFC 1/4] driver core: Register SoC bus after platform bus
Date: Fri, 16 Aug 2013 22:39:20 +0200 [thread overview]
Message-ID: <1376685563-1053-2-git-send-email-treding@nvidia.com> (raw)
In-Reply-To: <1376685563-1053-1-git-send-email-treding@nvidia.com>
Instead of registering the SoC bus as a core initcall, call it directly
from driver_init() to make it explicit when it is called. This is done
in preparation for early device registration support.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
drivers/base/base.h | 5 +++++
drivers/base/init.c | 1 +
drivers/base/soc.c | 11 +----------
3 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/base/base.h b/drivers/base/base.h
index 2cbc677..77e0722 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -99,6 +99,11 @@ extern int hypervisor_init(void);
static inline int hypervisor_init(void) { return 0; }
#endif
extern int platform_bus_init(void);
+#ifdef CONFIG_SOC_BUS
+extern int soc_bus_init(void);
+#else
+static inline int soc_bus_init(void) { return 0; }
+#endif
extern void cpu_dev_init(void);
struct kobject *virtual_device_parent(struct device *dev);
diff --git a/drivers/base/init.c b/drivers/base/init.c
index c16f0b8..a4c4090 100644
--- a/drivers/base/init.c
+++ b/drivers/base/init.c
@@ -31,6 +31,7 @@ void __init driver_init(void)
* core core pieces.
*/
platform_bus_init();
+ soc_bus_init();
cpu_dev_init();
memory_dev_init();
}
diff --git a/drivers/base/soc.c b/drivers/base/soc.c
index 72b5e72..ea116f4 100644
--- a/drivers/base/soc.c
+++ b/drivers/base/soc.c
@@ -166,16 +166,7 @@ void soc_device_unregister(struct soc_device *soc_dev)
device_unregister(&soc_dev->dev);
}
-static int __init soc_bus_register(void)
+int __init soc_bus_init(void)
{
return bus_register(&soc_bus_type);
}
-core_initcall(soc_bus_register);
-
-static void __exit soc_bus_unregister(void)
-{
- ida_destroy(&soc_ida);
-
- bus_unregister(&soc_bus_type);
-}
-module_exit(soc_bus_unregister);
--
1.8.3.4
next prev parent reply other threads:[~2013-08-16 22:24 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-16 20:39 [RFC 0/4] Early device registration Thierry Reding
2013-08-16 20:39 ` Thierry Reding [this message]
2013-08-16 20:39 ` [RFC 2/4] driver core: Allow early registration of devices Thierry Reding
2013-08-16 21:06 ` Greg Kroah-Hartman
2013-08-16 21:55 ` Thierry Reding
2013-08-16 22:08 ` Greg Kroah-Hartman
2013-08-17 11:17 ` Thierry Reding
2013-08-19 19:43 ` Stephen Warren
2013-08-19 20:10 ` Thierry Reding
2013-08-19 20:53 ` Stephen Warren
2013-08-19 21:41 ` Thierry Reding
2013-08-16 22:20 ` Grant Likely
2013-08-16 22:35 ` Greg Kroah-Hartman
2013-08-17 10:26 ` Tomasz Figa
2013-08-19 19:49 ` Stephen Warren
2013-08-19 20:04 ` Thierry Reding
2013-08-17 11:07 ` Thierry Reding
2013-08-16 20:39 ` [RFC 3/4] ARM: tegra: Call of_platform_populate() early Thierry Reding
2013-08-16 20:39 ` [RFC 4/4] OF: Add device pointer to struct device_node Thierry Reding
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=1376685563-1053-2-git-send-email-treding@nvidia.com \
--to=thierry.reding@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=hdoyu@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=rob.herring@calxeda.com \
--cc=sebastian.hesselbarth@gmail.com \
--cc=swarren@wwwdotorg.org \
/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