Skip to contentSkip to conversation

v4l: i2c cleanups

PATCH In review Gerd Knorr 1 participant 1 message Aug 31, 2004 Media (V4L/DVB)

lore
Share & tools
lore

Gerd Knorr

author
#0 lore raw

PATCH 1/4 v4l: i2c cleanups

Hi,

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.

please apply,

Gerd

drivers/media/video/msp3400.c +5 -6
diff -up linux-2.6.9-rc1/drivers/media/video/msp3400.c linux/drivers/media/video/msp3400.c
@@ -737,7 +737,7 @@ autodetect_stereo(struct i2c_client *cli
 static int msp34xx_sleep(struct msp3400c *msp, int timeout)
 {
 	DECLARE_WAITQUEUE(wait, current);
-
+	
 	add_wait_queue(&msp->wq, &wait);
 	if (!msp->rmmod) {
 		set_current_state(TASK_INTERRUPTIBLE);
@@ -1444,7 +1444,7 @@ static int msp_command(struct i2c_client
 			msp3400c_setcarrier(client, MSP_CARRIER(10.7),
 					    MSP_CARRIER(10.7));
 			msp3400c_setvolume(client, msp->muted,
-					   msp->volume, msp->balance);
+					   msp->volume, msp->balance);	
 		}
 		if (msp->active)
 			msp->restart = 1;
@@ -1552,13 +1552,12 @@ static int msp_command(struct i2c_client
 
 /* ----------------------------------------------------------------------- */
 
-static int msp3400_init_module(void)
+static int __init msp3400_init_module(void)
 {
-	i2c_add_driver(&driver);
-	return 0;
+	return i2c_add_driver(&driver);
 }
 
-static void msp3400_cleanup_module(void)
+static void __exit msp3400_cleanup_module(void)
 {
 	i2c_del_driver(&driver);
 }
drivers/media/video/tda7432.c +4 -4
diff -up linux-2.6.9-rc1/drivers/media/video/tda7432.c linux/drivers/media/video/tda7432.c
@@ -532,17 +532,17 @@ static struct i2c_client client_template
 	.driver     = &driver, 
 };
 
-static int tda7432_init(void)
+static int __init tda7432_init(void)
 {
 	if ( (loudness < 0) || (loudness > 15) ) {
 		printk(KERN_ERR "tda7432: loudness parameter must be between 0 and 15\n");
 		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);
 }
drivers/media/video/tda9875.c +3 -4
diff -up linux-2.6.9-rc1/drivers/media/video/tda9875.c linux/drivers/media/video/tda9875.c
@@ -403,13 +403,12 @@ static struct i2c_client client_template
         .driver    = &driver,
 };
 
-static int tda9875_init(void)
+static int __init tda9875_init(void)
 {
-	i2c_add_driver(&driver);
-	return 0;
+	return i2c_add_driver(&driver);
 }
 
-static void tda9875_fini(void)
+static void __exit tda9875_fini(void)
 {
 	i2c_del_driver(&driver);
 }
drivers/media/video/tvaudio.c +5 -5
diff -up linux-2.6.9-rc1/drivers/media/video/tvaudio.c linux/drivers/media/video/tvaudio.c
@@ -277,7 +277,7 @@ static int chip_thread(void *data)
 	daemonize("%s",i2c_clientname(&chip->c));
 	allow_signal(SIGTERM);
 	dprintk("%s: thread started\n", i2c_clientname(&chip->c));
-
+	
 	for (;;) {
 		add_wait_queue(&chip->wq, &wait);
 		if (!chip->done) {
@@ -1651,7 +1651,7 @@ static struct i2c_client client_template
         .driver     = &driver,
 };
 
-static int audiochip_init_module(void)
+static int __init audiochip_init_module(void)
 {
 	struct CHIPDESC  *desc;
 	printk(KERN_INFO "tvaudio: TV audio decoder + audio/video mux driver\n");
@@ -1659,11 +1659,11 @@ static int audiochip_init_module(void)
 	for (desc = chiplist; desc->name != NULL; desc++)
 		printk("%s%s", (desc == chiplist) ? "" : ",",desc->name);
 	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);
 }
drivers/media/video/tvmixer.c +4 -4
diff -up linux-2.6.9-rc1/drivers/media/video/tvmixer.c linux/drivers/media/video/tvmixer.c
@@ -330,17 +330,17 @@ static int tvmixer_clients(struct i2c_cl
 
 /* ----------------------------------------------------------------------- */
 
-static int tvmixer_init_module(void)
+static int __init tvmixer_init_module(void)
 {
 	int i;
 	
 	for (i = 0; i < DEV_MAX; i++)
 		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;
 	
include/media/id.h +0 -1
diff -up linux-2.6.9-rc1/include/media/id.h linux/include/media/id.h
@@ -35,4 +35,3 @@
 #ifndef I2C_ALGO_SAA7134
 # define I2C_ALGO_SAA7134 0x090000
 #endif
-
Signature · 1 line
return -ENOSIG;