Commit 8e3f8f30 authored by Gerd Knorr's avatar Gerd Knorr Committed by Linus Torvalds

[PATCH] v4l: i2c cleanups

This patch has some minor cleanups for the v4l i2c modules: Don't ignore
the i2c_add_driver return value and mark the init+exit functions with
__init + __exit.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b25f6a5d
...@@ -1552,13 +1552,12 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) ...@@ -1552,13 +1552,12 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static int msp3400_init_module(void) static int __init msp3400_init_module(void)
{ {
i2c_add_driver(&driver); return i2c_add_driver(&driver);
return 0;
} }
static void msp3400_cleanup_module(void) static void __exit msp3400_cleanup_module(void)
{ {
i2c_del_driver(&driver); i2c_del_driver(&driver);
} }
......
...@@ -532,17 +532,17 @@ static struct i2c_client client_template = ...@@ -532,17 +532,17 @@ static struct i2c_client client_template =
.driver = &driver, .driver = &driver,
}; };
static int tda7432_init(void) static int __init tda7432_init(void)
{ {
if ( (loudness < 0) || (loudness > 15) ) { if ( (loudness < 0) || (loudness > 15) ) {
printk(KERN_ERR "tda7432: loudness parameter must be between 0 and 15\n"); printk(KERN_ERR "tda7432: loudness parameter must be between 0 and 15\n");
return -EINVAL; return -EINVAL;
} }
i2c_add_driver(&driver);
return 0; return i2c_add_driver(&driver);
} }
static void tda7432_fini(void) static void __exit tda7432_fini(void)
{ {
i2c_del_driver(&driver); i2c_del_driver(&driver);
} }
......
...@@ -403,13 +403,12 @@ static struct i2c_client client_template = ...@@ -403,13 +403,12 @@ static struct i2c_client client_template =
.driver = &driver, .driver = &driver,
}; };
static int tda9875_init(void) static int __init tda9875_init(void)
{ {
i2c_add_driver(&driver); return i2c_add_driver(&driver);
return 0;
} }
static void tda9875_fini(void) static void __exit tda9875_fini(void)
{ {
i2c_del_driver(&driver); i2c_del_driver(&driver);
} }
......
...@@ -1651,7 +1651,7 @@ static struct i2c_client client_template = ...@@ -1651,7 +1651,7 @@ static struct i2c_client client_template =
.driver = &driver, .driver = &driver,
}; };
static int audiochip_init_module(void) static int __init audiochip_init_module(void)
{ {
struct CHIPDESC *desc; struct CHIPDESC *desc;
printk(KERN_INFO "tvaudio: TV audio decoder + audio/video mux driver\n"); printk(KERN_INFO "tvaudio: TV audio decoder + audio/video mux driver\n");
...@@ -1659,11 +1659,11 @@ static int audiochip_init_module(void) ...@@ -1659,11 +1659,11 @@ static int audiochip_init_module(void)
for (desc = chiplist; desc->name != NULL; desc++) for (desc = chiplist; desc->name != NULL; desc++)
printk("%s%s", (desc == chiplist) ? "" : ",",desc->name); printk("%s%s", (desc == chiplist) ? "" : ",",desc->name);
printk("\n"); printk("\n");
i2c_add_driver(&driver);
return 0; return i2c_add_driver(&driver);
} }
static void audiochip_cleanup_module(void) static void __exit audiochip_cleanup_module(void)
{ {
i2c_del_driver(&driver); i2c_del_driver(&driver);
} }
......
...@@ -330,17 +330,17 @@ static int tvmixer_clients(struct i2c_client *client) ...@@ -330,17 +330,17 @@ static int tvmixer_clients(struct i2c_client *client)
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static int tvmixer_init_module(void) static int __init tvmixer_init_module(void)
{ {
int i; int i;
for (i = 0; i < DEV_MAX; i++) for (i = 0; i < DEV_MAX; i++)
devices[i].minor = -1; devices[i].minor = -1;
i2c_add_driver(&driver);
return 0; return i2c_add_driver(&driver);
} }
static void tvmixer_cleanup_module(void) static void __exit tvmixer_cleanup_module(void)
{ {
int i; int i;
......
...@@ -35,4 +35,3 @@ ...@@ -35,4 +35,3 @@
#ifndef I2C_ALGO_SAA7134 #ifndef I2C_ALGO_SAA7134
# define I2C_ALGO_SAA7134 0x090000 # define I2C_ALGO_SAA7134 0x090000
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment