i2c-gpio: Move initialization code to subsys_initcall()
authorMarek Szyprowski <[email protected]>
Fri, 21 May 2010 16:40:58 +0000 (18:40 +0200)
committerJean Delvare <[email protected]>
Fri, 21 May 2010 16:40:58 +0000 (18:40 +0200)
GPIO driven I2C bus can be used for controlling the PMIC chip. The
example of such configuration is Samsung Aquila board.

This patch moves initialization code to subsys_initcall() to ensure
that the i2c bus is available early so the regulators can be quickly
probed and available for other devices on their probe() call.

Such solution has been proposed by Mark Brown to fix the problem of
the regulators not beeing available on the peripheral device probe():
http://lists.infradead.org/pipermail/linux-arm-kernel/2010-March/011971.html

Cc: Mark Brown <[email protected]>
Reviewed-by: Kyungmin Park <[email protected]>
Signed-off-by: Marek Szyprowski <[email protected]>
Acked-by: Wolfram Sang <[email protected]>
Signed-off-by: Jean Delvare <[email protected]>
drivers/i2c/busses/i2c-gpio.c

index c21077d248af98f342a37219ecfa19b580e65c32..d9aa9a649e3587a015821611a7544387a95eb905 100644 (file)
@@ -211,7 +211,7 @@ static int __init i2c_gpio_init(void)
 
        return ret;
 }
-module_init(i2c_gpio_init);
+subsys_initcall(i2c_gpio_init);
 
 static void __exit i2c_gpio_exit(void)
 {