diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-02-12 06:56:32 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-03-08 08:48:01 -0300 |
commit | c6e8d86fffd8edf1bfccbd441b1812ee919fe3d5 (patch) | |
tree | 3b4a8b33ebf13cfc33513ef8b7c9f2e8ba50f2d9 | |
parent | a2d2b25ce623757a87b35ef336d2d2c3b0a6fa13 (diff) |
[media] convert drivers/media/* to use module_i2c_driver()
This patch converts the drivers in drivers/media/* to use the
module_i2_driver() macro which makes the code smaller and a bit simpler.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Heungjun Kim <riverful.kim@samsung.com>
Cc: Joonyoung Shim <jy0922.shim@samsung.com>
Cc: Andrew Chew <achew@nvidia.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Michael Grzeschik <m.grzeschik@pengutronix.de>
Cc: Johannes Obermaier <johannes.obermaier@gmail.com>
Cc: Steven Toth <stoth@kernellabs.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
73 files changed, 75 insertions, 940 deletions
diff --git a/drivers/media/dvb/frontends/au8522_decoder.c b/drivers/media/dvb/frontends/au8522_decoder.c index 2b248c12f40..55b6390198e 100644 --- a/drivers/media/dvb/frontends/au8522_decoder.c +++ b/drivers/media/dvb/frontends/au8522_decoder.c @@ -839,15 +839,4 @@ static struct i2c_driver au8522_driver = { .id_table = au8522_id, }; -static __init int init_au8522(void) -{ - return i2c_add_driver(&au8522_driver); -} - -static __exit void exit_au8522(void) -{ - i2c_del_driver(&au8522_driver); -} - -module_init(init_au8522); -module_exit(exit_au8522); +module_i2c_driver(au8522_driver); diff --git a/drivers/media/radio/radio-tea5764.c b/drivers/media/radio/radio-tea5764.c index db20904d01f..6b1fae32b48 100644 --- a/drivers/media/radio/radio-tea5764.c +++ b/drivers/media/radio/radio-tea5764.c @@ -575,21 +575,7 @@ static struct i2c_driver tea5764_i2c_driver = { .id_table = tea5764_id, }; -/* init the driver */ -static int __init tea5764_init(void) -{ - int ret = i2c_add_driver(&tea5764_i2c_driver); - - printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ": " - DRIVER_DESC "\n"); - return ret; -} - -/* cleanup the driver */ -static void __exit tea5764_exit(void) -{ - i2c_del_driver(&tea5764_i2c_driver); -} +module_i2c_driver(tea5764_i2c_driver); MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); @@ -600,6 +586,3 @@ module_param(use_xtal, int, 0); MODULE_PARM_DESC(use_xtal, "Chip have a xtal connected in board"); module_param(radio_nr, int, 0); MODULE_PARM_DESC(radio_nr, "video4linux device number to use"); - -module_init(tea5764_init); -module_exit(tea5764_exit); diff --git a/drivers/media/radio/saa7706h.c b/drivers/media/radio/saa7706h.c index b1193dfc508..9474706350f 100644 --- a/drivers/media/radio/saa7706h.c +++ b/drivers/media/radio/saa7706h.c @@ -434,18 +434,7 @@ static struct i2c_driver saa7706h_driver = { .id_table = saa7706h_id, }; -static __init int saa7706h_init(void) -{ - return i2c_add_driver(&saa7706h_driver); -} - -static __exit void saa7706h_exit(void) -{ - i2c_del_driver(&saa7706h_driver); -} - -module_init(saa7706h_init); -module_exit(saa7706h_exit); +module_i2c_driver(saa7706h_driver); MODULE_DESCRIPTION("SAA7706H Car Radio DSP driver"); MODULE_AUTHOR("Mocean Laboratories"); diff --git a/drivers/media/radio/si470x/radio-si470x-i2c.c b/drivers/media/radio/si470x/radio-si470x-i2c.c index fd3541b0e91..9b546a5523f 100644 --- a/drivers/media/radio/si470x/radio-si470x-i2c.c +++ b/drivers/media/radio/si470x/radio-si470x-i2c.c @@ -539,33 +539,7 @@ static struct i2c_driver si470x_i2c_driver = { .id_table = si470x_i2c_id, }; - - -/************************************************************************** - * Module Interface - **************************************************************************/ - -/* - * si470x_i2c_init - module init - */ -static int __init si470x_i2c_init(void) -{ - printk(KERN_INFO DRIVER_DESC ", Version " DRIVER_VERSION "\n"); - return i2c_add_driver(&si470x_i2c_driver); -} - - -/* - * si470x_i2c_exit - module exit - */ -static void __exit si470x_i2c_exit(void) -{ - i2c_del_driver(&si470x_i2c_driver); -} - - -module_init(si470x_i2c_init); -module_exit(si470x_i2c_exit); +module_i2c_driver(si470x_i2c_driver); MODULE_LICENSE("GPL"); MODULE_AUTHOR(DRIVER_AUTHOR); diff --git a/drivers/media/radio/si4713-i2c.c b/drivers/media/radio/si4713-i2c.c index 27aba936fb2..b898c8925ab 100644 --- a/drivers/media/radio/si4713-i2c.c +++ b/drivers/media/radio/si4713-i2c.c @@ -2106,17 +2106,4 @@ static struct i2c_driver si4713_i2c_driver = { .id_table = si4713_id, }; -/* Module Interface */ -static int __init si4713_module_init(void) -{ - return i2c_add_driver(&si4713_i2c_driver); -} - -static void __exit si4713_module_exit(void) -{ - i2c_del_driver(&si4713_i2c_driver); -} - -module_init(si4713_module_init); -module_exit(si4713_module_exit); - +module_i2c_driver(si4713_i2c_driver); diff --git a/drivers/media/radio/tef6862.c b/drivers/media/radio/tef6862.c index 3408685b690..6418c4c9faf 100644 --- a/drivers/media/radio/tef6862.c +++ b/drivers/media/radio/tef6862.c @@ -215,20 +215,8 @@ static struct i2c_driver tef6862_driver = { .id_table = tef6862_id, }; -static __init int tef6862_init(void) -{ - return i2c_add_driver(&tef6862_driver); -} - -static __exit void tef6862_exit(void) -{ - i2c_del_driver(&tef6862_driver); -} - -module_init(tef6862_init); -module_exit(tef6862_exit); +module_i2c_driver(tef6862_driver); MODULE_DESCRIPTION("TEF6862 Car Radio Enhanced Selectivity Tuner"); MODULE_AUTHOR("Mocean Laboratories"); MODULE_LICENSE("GPL v2"); - diff --git a/drivers/media/video/adp1653.c b/drivers/media/video/adp1653.c index 12eedf4d515..0d13f052997 100644 --- a/drivers/media/video/adp1653.c +++ b/drivers/media/video/adp1653.c @@ -482,24 +482,7 @@ static struct i2c_driver adp1653_i2c_driver = { .id_table = adp1653_id_table, }; -static int __init adp1653_init(void) -{ - int rval; - - rval = i2c_add_driver(&adp1653_i2c_driver); - if (rval) - printk(KERN_ALERT "%s: failed at i2c_add_driver\n", __func__); - - return rval; -} - -static void __exit adp1653_exit(void) -{ - i2c_del_driver(&adp1653_i2c_driver); -} - -module_init(adp1653_init); -module_exit(adp1653_exit); +module_i2c_driver(adp1653_i2c_driver); MODULE_AUTHOR("Sakari Ailus <sakari.ailus@nokia.com>"); MODULE_DESCRIPTION("Analog Devices ADP1653 LED flash driver"); diff --git a/drivers/media/video/adv7170.c b/drivers/media/video/adv7170.c index 879f1d83976..6bc01fb98ff 100644 --- a/drivers/media/video/adv7170.c +++ b/drivers/media/video/adv7170.c @@ -407,15 +407,4 @@ static struct i2c_driver adv7170_driver = { .id_table = adv7170_id, }; -static __init int init_adv7170(void) -{ - return i2c_add_driver(&adv7170_driver); -} - -static __exit void exit_adv7170(void) -{ - i2c_del_driver(&adv7170_driver); -} - -module_init(init_adv7170); -module_exit(exit_adv7170); +module_i2c_driver(adv7170_driver); diff --git a/drivers/media/video/adv7175.c b/drivers/media/video/adv7175.c index 206078eca85..c7640fab573 100644 --- a/drivers/media/video/adv7175.c +++ b/drivers/media/video/adv7175.c @@ -457,15 +457,4 @@ static struct i2c_driver adv7175_driver = { .id_table = adv7175_id, }; -static __init int init_adv7175(void) -{ - return i2c_add_driver(&adv7175_driver); -} - -static __exit void exit_adv7175(void) -{ - i2c_del_driver(&adv7175_driver); -} - -module_init(init_adv7175); -module_exit(exit_adv7175); +module_i2c_driver(adv7175_driver); diff --git a/drivers/media/video/adv7180.c b/drivers/media/video/adv7180.c index d2138d06bca..b8b6c4b0cad 100644 --- a/drivers/media/video/adv7180.c +++ b/drivers/media/video/adv7180.c @@ -444,20 +444,8 @@ static struct i2c_driver adv7180_driver = { .id_table = adv7180_id, }; -static __init int adv7180_init(void) -{ - return i2c_add_driver(&adv7180_driver); -} - -static __exit void adv7180_exit(void) -{ - i2c_del_driver(&adv7180_driver); -} - -module_init(adv7180_init); -module_exit(adv7180_exit); +module_i2c_driver(adv7180_driver); MODULE_DESCRIPTION("Analog Devices ADV7180 video decoder driver"); MODULE_AUTHOR("Mocean Laboratories"); MODULE_LICENSE("GPL v2"); - diff --git a/drivers/media/video/adv7343.c b/drivers/media/video/adv7343.c index 021fab23070..119b60401bf 100644 --- a/drivers/media/video/adv7343.c +++ b/drivers/media/video/adv7343.c @@ -475,15 +475,4 @@ static struct i2c_driver adv7343_driver = { .id_table = adv7343_id, }; -static __init int init_adv7343(void) -{ - return i2c_add_driver(&adv7343_driver); -} - -static __exit void exit_adv7343(void) -{ - i2c_del_driver(&adv7343_driver); -} - -module_init(init_adv7343); -module_exit(exit_adv7343); +module_i2c_driver(adv7343_driver); diff --git a/drivers/media/video/ak881x.c b/drivers/media/video/ak881x.c index 53c496c00fb..ba674656b10 100644 --- a/drivers/media/video/ak881x.c +++ b/drivers/media/video/ak881x.c @@ -352,18 +352,7 @@ static struct i2c_driver ak881x_i2c_driver = { .id_table = ak881x_id, }; -static int __init ak881x_module_init(void) -{ - return i2c_add_driver(&ak881x_i2c_driver); -} - -static void __exit ak881x_module_exit(void) -{ - i2c_del_driver(&ak881x_i2c_driver); -} - -module_init(ak881x_module_init); -module_exit(ak881x_module_exit); +module_i2c_driver(ak881x_i2c_driver); MODULE_DESCRIPTION("TV-output driver for ak8813/ak8814"); MODULE_AUTHOR("Guennadi Liakhovetski <g.liakhovetski@gmx.de>"); diff --git a/drivers/media/video/as3645a.c b/drivers/media/video/as3645a.c index f241702a0f3..7a3371f044f 100644 --- a/drivers/media/video/as3645a.c +++ b/drivers/media/video/as3645a.c @@ -881,24 +881,7 @@ static struct i2c_driver as3645a_i2c_driver = { .id_table = as3645a_id_table, }; -static int __init as3645a_init(void) -{ - int rval; - - rval = i2c_add_driver(&as3645a_i2c_driver); - if (rval) - pr_err("%s: Failed to register the driver\n", AS3645A_NAME); - - return rval; -} - -static void __exit as3645a_exit(void) -{ - i2c_del_driver(&as3645a_i2c_driver); -} - -module_init(as3645a_init); -module_exit(as3645a_exit); +module_i2c_driver(as3645a_i2c_driver); MODULE_AUTHOR("Laurent Pinchart <laurent.pinchart@ideasonboard.com>"); MODULE_DESCRIPTION("LED flash driver for AS3645A, LM3555 and their clones"); diff --git a/drivers/media/video/bt819.c b/drivers/media/video/bt819.c index 859eabf5797..377bf05b1ef 100644 --- a/drivers/media/video/bt819.c +++ b/drivers/media/video/bt819.c @@ -514,15 +514,4 @@ static struct i2c_driver bt819_driver = { .id_table = bt819_id, }; -static __init int init_bt819(void) -{ - return i2c_add_driver(&bt819_driver); -} - -static __exit void exit_bt819(void) -{ - i2c_del_driver(&bt819_driver); -} - -module_init(init_bt819); -module_exit(exit_bt819); +module_i2c_driver(bt819_driver); diff --git a/drivers/media/video/bt856.c b/drivers/media/video/bt856.c index a43059d4c79..7e5bd365c23 100644 --- a/drivers/media/video/bt856.c +++ b/drivers/media/video/bt856.c @@ -270,15 +270,4 @@ static struct i2c_driver bt856_driver = { .id_table = bt856_id, }; -static __init int init_bt856(void) -{ - return i2c_add_driver(&bt856_driver); -} - -static __exit void exit_bt856(void) -{ - i2c_del_driver(&bt856_driver); -} - -module_init(init_bt856); -module_exit(exit_bt856); +module_i2c_driver(bt856_driver); diff --git a/drivers/media/video/bt866.c b/drivers/media/video/bt866.c index 4e5dcea0501..905320b67a1 100644 --- a/drivers/media/video/bt866.c +++ b/drivers/media/video/bt866.c @@ -240,15 +240,4 @@ static struct i2c_driver bt866_driver = { .id_table = bt866_id, }; -static __init int init_bt866(void) -{ - return i2c_add_driver(&bt866_driver); -} - -static __exit void exit_bt866(void) -{ - i2c_del_driver(&bt866_driver); -} - -module_init(init_bt866); -module_exit(exit_bt866); +module_i2c_driver(bt866_driver); diff --git a/drivers/media/video/cs5345.c b/drivers/media/video/cs5345.c index 1d64af9adf7..c8581e26fa9 100644 --- a/drivers/media/video/cs5345.c +++ b/drivers/media/video/cs5345.c @@ -249,15 +249,4 @@ static struct i2c_driver cs5345_driver = { .id_table = cs5345_id, }; -static __init int init_cs5345(void) -{ - return i2c_add_driver(&cs5345_driver); -} - -static __exit void exit_cs5345(void) -{ - i2c_del_driver(&cs5345_driver); -} - -module_init(init_cs5345); -module_exit(exit_cs5345); +module_i2c_driver(cs5345_driver); diff --git a/drivers/media/video/cs53l32a.c b/drivers/media/video/cs53l32a.c index 51c5b9ad67d..b293912206e 100644 --- a/drivers/media/video/cs53l32a.c +++ b/drivers/media/video/cs53l32a.c @@ -248,15 +248,4 @@ static struct i2c_driver cs53l32a_driver = { .id_table = cs53l32a_id, }; -static __init int init_cs53l32a(void) -{ - return i2c_add_driver(&cs53l32a_driver); -} - -static __exit void exit_cs53l32a(void) -{ - i2c_del_driver(&cs53l32a_driver); -} - -module_init(init_cs53l32a); -module_exit(exit_cs53l32a); +module_i2c_driver(cs53l32a_driver); diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index 05247d4c340..fc1ff69cffd 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c @@ -5301,15 +5301,4 @@ static struct i2c_driver cx25840_driver = { .id_table = cx25840_id, }; -static __init int init_cx25840(void) -{ - return i2c_add_driver(&cx25840_driver); -} - -static __exit void exit_cx25840(void) -{ - i2c_del_driver(&cx25840_driver); -} - -module_init(init_cx25840); -module_exit(exit_cx25840); +module_i2c_driver(cx25840_driver); diff --git a/drivers/media/video/imx074.c b/drivers/media/video/imx074.c index eec75bb5720..351e9bafe8f 100644 --- a/drivers/media/video/imx074.c +++ b/drivers/media/video/imx074.c @@ -468,18 +468,7 @@ static struct i2c_driver imx074_i2c_driver = { .id_table = imx074_id, }; -static int __init imx074_mod_init(void) -{ - return i2c_add_driver(&imx074_i2c_driver); -} - -static void __exit imx074_mod_exit(void) -{ - i2c_del_driver(&imx074_i2c_driver); -} - -module_init(imx074_mod_init); -module_exit(imx074_mod_exit); |