mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
i2c: immediately mark ourselves as registered
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 <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
Fixes: 95026658c4 ("i2c: do not use internal data from driver core")
This commit is contained in:
parent
34b57f40a6
commit
b980a26d02
1 changed files with 4 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
@ -2127,6 +2129,7 @@ class_err:
|
|||
class_compat_unregister(i2c_adapter_compat_class);
|
||||
bus_err:
|
||||
#endif
|
||||
is_registered = false;
|
||||
bus_unregister(&i2c_bus_type);
|
||||
return retval;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue