Skip to content

Commit

Permalink
[media] convert drivers/media/* to use module_i2c_driver()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Axel Lin authored and Mauro Carvalho Chehab committed Mar 8, 2012
1 parent a2d2b25 commit c6e8d86
Show file tree
Hide file tree
Showing 73 changed files with 75 additions and 940 deletions.
13 changes: 1 addition & 12 deletions drivers/media/dvb/frontends/au8522_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
19 changes: 1 addition & 18 deletions drivers/media/radio/radio-tea5764.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
13 changes: 1 addition & 12 deletions drivers/media/radio/saa7706h.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
28 changes: 1 addition & 27 deletions drivers/media/radio/si470x/radio-si470x-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
15 changes: 1 addition & 14 deletions drivers/media/radio/si4713-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
14 changes: 1 addition & 13 deletions drivers/media/radio/tef6862.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");

19 changes: 1 addition & 18 deletions drivers/media/video/adp1653.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
13 changes: 1 addition & 12 deletions drivers/media/video/adv7170.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
13 changes: 1 addition & 12 deletions drivers/media/video/adv7175.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
14 changes: 1 addition & 13 deletions drivers/media/video/adv7180.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");

13 changes: 1 addition & 12 deletions drivers/media/video/adv7343.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
13 changes: 1 addition & 12 deletions drivers/media/video/ak881x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>");
Expand Down
19 changes: 1 addition & 18 deletions drivers/media/video/as3645a.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
13 changes: 1 addition & 12 deletions drivers/media/video/bt819.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
13 changes: 1 addition & 12 deletions drivers/media/video/bt856.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
13 changes: 1 addition & 12 deletions drivers/media/video/bt866.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
13 changes: 1 addition & 12 deletions drivers/media/video/cs5345.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
13 changes: 1 addition & 12 deletions drivers/media/video/cs53l32a.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
13 changes: 1 addition & 12 deletions drivers/media/video/cx25840/cx25840-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Loading

0 comments on commit c6e8d86

Please sign in to comment.