All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Knorr <kraxel@bytesex.org>
To: Andrew Morton <akpm@osdl.org>,
	Kernel List <linux-kernel@vger.kernel.org>
Subject: [patch 1/4] v4l: i2c cleanups
Date: Tue, 31 Aug 2004 17:15:28 +0200	[thread overview]
Message-ID: <20040831151528.GA15535@bytesex> (raw)

  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

diff -up linux-2.6.9-rc1/drivers/media/video/msp3400.c linux/drivers/media/video/msp3400.c
--- linux-2.6.9-rc1/drivers/media/video/msp3400.c	2004-08-25 16:12:38.000000000 +0200
+++ linux/drivers/media/video/msp3400.c	2004-08-25 18:20:57.876559437 +0200
@@ -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);
 }
diff -up linux-2.6.9-rc1/drivers/media/video/tda7432.c linux/drivers/media/video/tda7432.c
--- linux-2.6.9-rc1/drivers/media/video/tda7432.c	2004-08-25 16:12:51.000000000 +0200
+++ linux/drivers/media/video/tda7432.c	2004-08-25 18:20:57.879558876 +0200
@@ -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);
 }
diff -up linux-2.6.9-rc1/drivers/media/video/tda9875.c linux/drivers/media/video/tda9875.c
--- linux-2.6.9-rc1/drivers/media/video/tda9875.c	2004-08-25 16:12:07.000000000 +0200
+++ linux/drivers/media/video/tda9875.c	2004-08-25 18:20:57.881558502 +0200
@@ -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);
 }
diff -up linux-2.6.9-rc1/drivers/media/video/tvaudio.c linux/drivers/media/video/tvaudio.c
--- linux-2.6.9-rc1/drivers/media/video/tvaudio.c	2004-08-25 16:11:53.000000000 +0200
+++ linux/drivers/media/video/tvaudio.c	2004-08-25 18:20:57.885557754 +0200
@@ -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);
 }
diff -up linux-2.6.9-rc1/drivers/media/video/tvmixer.c linux/drivers/media/video/tvmixer.c
--- linux-2.6.9-rc1/drivers/media/video/tvmixer.c	2004-08-25 16:13:26.000000000 +0200
+++ linux/drivers/media/video/tvmixer.c	2004-08-25 18:20:57.887557380 +0200
@@ -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;
 	
diff -up linux-2.6.9-rc1/include/media/id.h linux/include/media/id.h
--- linux-2.6.9-rc1/include/media/id.h	2004-08-25 16:12:15.000000000 +0200
+++ linux/include/media/id.h	2004-08-25 18:20:57.889557007 +0200
@@ -35,4 +35,3 @@
 #ifndef I2C_ALGO_SAA7134
 # define I2C_ALGO_SAA7134 0x090000
 #endif
-

-- 
return -ENOSIG;

                 reply	other threads:[~2004-08-31 15:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040831151528.GA15535@bytesex \
    --to=kraxel@bytesex.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.