linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: immediately mark ourselves as registered
@ 2016-03-14  9:53 Wolfram Sang
  2016-03-14 14:19 ` Sudip Mukherjee
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2016-03-14  9:53 UTC (permalink / raw)
  To: linux-i2c; +Cc: linux-kernel, Sudip Mukherjee, Wolfram Sang, Thierry Reding

Mark the i2c bus as registered right after the the bus_register call,
not at the end of init. Otherwise, we can't register our own dummy
driver.

Reported-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Fixes: 95026658c46ea2 ("i2c: do not use internal data from driver core")
---
 drivers/i2c/i2c-core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index f4726cdbb06a1e..f267b238c6730c 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -2105,6 +2105,9 @@ static int __init i2c_init(void)
 	retval = bus_register(&i2c_bus_type);
 	if (retval)
 		return retval;
+
+	is_registered = true;
+
 #ifdef CONFIG_I2C_COMPAT
 	i2c_adapter_compat_class = class_compat_register("i2c-adapter");
 	if (!i2c_adapter_compat_class) {
@@ -2119,7 +2122,6 @@ static int __init i2c_init(void)
 	if (IS_ENABLED(CONFIG_OF_DYNAMIC))
 		WARN_ON(of_reconfig_notifier_register(&i2c_of_notifier));
 
-	is_registered = true;
 	return 0;
 
 class_err:
-- 
2.7.0

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

end of thread, other threads:[~2016-03-14 23:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-14  9:53 [PATCH] i2c: immediately mark ourselves as registered Wolfram Sang
2016-03-14 14:19 ` Sudip Mukherjee
2016-03-14 14:58   ` Wolfram Sang
2016-03-14 23:26     ` Nicolai Stange

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).