i2c: Convert drivers/i2c/muxes/* to use module_i2c_driver()
authorAxel Lin <axel.lin@gmail.com>
Mon, 26 Mar 2012 19:47:19 +0000 (21:47 +0200)
committerJean Delvare <khali@endymion.delvare>
Mon, 26 Mar 2012 19:47:19 +0000 (21:47 +0200)
This patch converts the drivers in drivers/i2c/muxes/* to use the
module_i2c_driver() macro which makes the code smaller and a bit simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Michael Lawnick <ml.lawnick@gmx.de>
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
drivers/i2c/muxes/pca9541.c
drivers/i2c/muxes/pca954x.c

index ed699c5aa79d033496f0a6eb1b1eb75b6de0e4c6..e0df9b6c66b34132dac3249fc58ad6ee01b758ca 100644 (file)
@@ -393,18 +393,7 @@ static struct i2c_driver pca9541_driver = {
        .id_table = pca9541_id,
 };
 
-static int __init pca9541_init(void)
-{
-       return i2c_add_driver(&pca9541_driver);
-}
-
-static void __exit pca9541_exit(void)
-{
-       i2c_del_driver(&pca9541_driver);
-}
-
-module_init(pca9541_init);
-module_exit(pca9541_exit);
+module_i2c_driver(pca9541_driver);
 
 MODULE_AUTHOR("Guenter Roeck <guenter.roeck@ericsson.com>");
 MODULE_DESCRIPTION("PCA9541 I2C master selector driver");
index 6f89536646365db2cf316d166c2df23959d2988e..0e37ef27aa129e614bf99b5e9d8f4f2dc5f72527 100644 (file)
@@ -284,18 +284,7 @@ static struct i2c_driver pca954x_driver = {
        .id_table       = pca954x_id,
 };
 
-static int __init pca954x_init(void)
-{
-       return i2c_add_driver(&pca954x_driver);
-}
-
-static void __exit pca954x_exit(void)
-{
-       i2c_del_driver(&pca954x_driver);
-}
-
-module_init(pca954x_init);
-module_exit(pca954x_exit);
+module_i2c_driver(pca954x_driver);
 
 MODULE_AUTHOR("Rodolfo Giometti <giometti@linux.it>");
 MODULE_DESCRIPTION("PCA954x I2C mux/switch driver");