Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1357268
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] i2c: immediately mark ourselves as registered |
| Date | 2016-03-14 15:20 +0100 |
| Message-ID | <rcBvJ-4Pn-33@gated-at.bofh.it> (permalink) |
| References | <rcxs5-22b-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Mar 14, 2016 at 10:53:26AM +0100, Wolfram Sang wrote:
> 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")
> ---
I think it should be:
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index f4726cd..065cd83 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:
@@ -2128,6 +2130,7 @@ class_err:
bus_err:
#endif
bus_unregister(&i2c_bus_type);
+ is_registered = false;
return retval;
}
otherwise even if i2c bus fails to register the flag says that i2c is registered.
Sorry again for the previous patch.
regards
sudip
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] i2c: immediately mark ourselves as registered Wolfram Sang <wsa@the-dreams.de> - 2016-03-14 11:00 +0100
Re: [PATCH] i2c: immediately mark ourselves as registered Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2016-03-14 15:20 +0100
Re: [PATCH] i2c: immediately mark ourselves as registered Wolfram Sang <wsa@the-dreams.de> - 2016-03-14 16:00 +0100
Re: [PATCH] i2c: immediately mark ourselves as registered Nicolai Stange <nicstange@gmail.com> - 2016-03-15 00:30 +0100
csiph-web