Skip to contentSkip to conversation

i2c: do earlier driver model init

PATCH In review David Brownell 2 participants 2 messages Sep 24, 2008 – Sep 30, 2008 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: do earlier driver model init

From: David Brownell <[email protected]>

Move I2C driver model init earlier in the boot sequence.

This avoids oopsing in statically linked systems when some subsystems register I2C drivers in subsys_initcall() code, but those subsystems are linked (and initialized) before I2C.

---
 drivers/i2c/i2c-core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/i2c-core.c +1 -1
@@ -1143,7 +1143,7 @@ static void __exit i2c_exit(void)
 	bus_unregister(&i2c_bus_type);
 }
 
-subsys_initcall(i2c_init);
+postcore_initcall(i2c_init);
 module_exit(i2c_exit);
 
 /* ----------------------------------------------------

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

A message that is not in the archive (sent off-list or not yet received): 200809240915.39917.david-b-yBeKhBN/[email protected]

#2 lore raw

Hi David,

Quoted 16 lines · David Brownell

From: David Brownell <[email protected]>

Move I2C driver model init earlier in the boot sequence.

This avoids oopsing in statically linked systems when some subsystems register I2C drivers in subsys_initcall() code, but those subsystems are linked (and initialized) before I2C.

---
 drivers/i2c/i2c-core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

drivers/i2c/i2c-core.c static void __exit i2c_exit(void) · line 1148

Quoted 7 lines
drivers/i2c/i2c-core.c +1 -1
@@ -1143,7 +1143,7 @@ static void __exit i2c_exit(void)
 	bus_unregister(&i2c_bus_type);
 }
 
-subsys_initcall(i2c_init);
+postcore_initcall(i2c_init);
 module_exit(i2c_exit);
 

Patch applied, thanks. Will go in 2.6.28, NOT 2.6.27 (too late there for such a change.)

Signature · 6 lines
Jean Delvare

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c