Skip to contentSkip to conversation

[2.6] drivers/media/video/tda9840.c: honour return code of i2c_add_driver()

PATCH New Michael Hunold 1 participant 1 message Jun 22, 2004 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 [2.6] drivers/media/video/tda9840.c: honour return code of i2c_add_driver()

Hello Linus,

i2c_add_driver() may actually fail, but my driver returns 0
regardless. Thanks to Arthur Othieno <[email protected]> for this obviously correct patch.

 tda9840.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/media/video/tda9840.c +3 -4
@@ -268,13 +268,12 @@ static struct i2c_driver driver = {
         .command	= tda9840_command,
 };
 
-static int tda9840_init_module(void)
+static int __init tda9840_init_module(void)
 {
-        i2c_add_driver(&driver);
-        return 0;
+        return i2c_add_driver(&driver);
 }
 
-static void tda9840_cleanup_module(void)
+static void __exit tda9840_cleanup_module(void)
 {
         i2c_del_driver(&driver);
 }