Commit 2cb63c4c authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mauro Carvalho Chehab

media: staging: atomisp: Use module_i2c_driver() macro

This is done using coccinelle semantic patch:

//<smpl>
@A@
identifier f, x;
@@
-static f(...) { return i2c_add_driver(&x); }

@b depends on a@
identifier e, a.x;
@@
-static e(...) { i2c_del_driver(&x); }

@c depends on a && b@
identifier a.f;
declarer name module_init;
@@
-module_init(f);

@d depends on a && b && c@
identifier b.e, a.x;
declarer name module_exit;
declarer name module_i2c_driver;
@@
-module_exit(e);
+module_i2c_driver(x);
//</smpl>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent d4870725
......@@ -1468,20 +1468,7 @@ static struct i2c_driver gc0310_driver = {
.remove = gc0310_remove,
.id_table = gc0310_id,
};
static int init_gc0310(void)
{
return i2c_add_driver(&gc0310_driver);
}
static void exit_gc0310(void)
{
i2c_del_driver(&gc0310_driver);
}
module_init(init_gc0310);
module_exit(exit_gc0310);
module_i2c_driver(gc0310_driver);
MODULE_AUTHOR("Lai, Angie <angie.lai@intel.com>");
MODULE_DESCRIPTION("A low-level driver for GalaxyCore GC0310 sensors");
......
......@@ -1197,20 +1197,7 @@ static struct i2c_driver gc2235_driver = {
.remove = gc2235_remove,
.id_table = gc2235_id,
};
static int init_gc2235(void)
{
return i2c_add_driver(&gc2235_driver);
}
static void exit_gc2235(void)
{
i2c_del_driver(&gc2235_driver);
}
module_init(init_gc2235);
module_exit(exit_gc2235);
module_i2c_driver(gc2235_driver);
MODULE_AUTHOR("Shuguang Gong <Shuguang.Gong@intel.com>");
MODULE_DESCRIPTION("A low-level driver for GC2235 sensors");
......
......@@ -989,19 +989,8 @@ static struct i2c_driver lm3554_driver = {
.remove = lm3554_remove,
.id_table = lm3554_id,
};
module_i2c_driver(lm3554_driver);
static __init int init_lm3554(void)
{
return i2c_add_driver(&lm3554_driver);
}
static __exit void exit_lm3554(void)
{
i2c_del_driver(&lm3554_driver);
}
module_init(init_lm3554);
module_exit(exit_lm3554);
MODULE_AUTHOR("Jing Tao <jing.tao@intel.com>");
MODULE_DESCRIPTION("LED flash driver for LM3554");
MODULE_LICENSE("GPL");
......@@ -1943,19 +1943,7 @@ static struct i2c_driver mt9m114_driver = {
.remove = mt9m114_remove,
.id_table = mt9m114_id,
};
static __init int init_mt9m114(void)
{
return i2c_add_driver(&mt9m114_driver);
}
static __exit void exit_mt9m114(void)
{
i2c_del_driver(&mt9m114_driver);
}
module_init(init_mt9m114);
module_exit(exit_mt9m114);
module_i2c_driver(mt9m114_driver);
MODULE_AUTHOR("Shuguang Gong <Shuguang.gong@intel.com>");
MODULE_LICENSE("GPL");
......@@ -1525,7 +1525,6 @@ MODULE_DEVICE_TABLE(acpi, ov2680_acpi_match);
MODULE_DEVICE_TABLE(i2c, ov2680_id);
static struct i2c_driver ov2680_driver = {
.driver = {
.owner = THIS_MODULE,
.name = OV2680_NAME,
.acpi_match_table = ACPI_PTR(ov2680_acpi_match),
......@@ -1534,20 +1533,7 @@ static struct i2c_driver ov2680_driver = {
.remove = ov2680_remove,
.id_table = ov2680_id,
};
static int init_ov2680(void)
{
return i2c_add_driver(&ov2680_driver);
}
static void exit_ov2680(void)
{
i2c_del_driver(&ov2680_driver);
}
module_init(init_ov2680);
module_exit(exit_ov2680);
module_i2c_driver(ov2680_driver);
MODULE_AUTHOR("Jacky Wang <Jacky_wang@ovt.com>");
MODULE_DESCRIPTION("A low-level driver for OmniVision 2680 sensors");
......
......@@ -1351,20 +1351,7 @@ static struct i2c_driver ov2722_driver = {
.remove = ov2722_remove,
.id_table = ov2722_id,
};
static int init_ov2722(void)
{
return i2c_add_driver(&ov2722_driver);
}
static void exit_ov2722(void)
{
i2c_del_driver(&ov2722_driver);
}
module_init(init_ov2722);
module_exit(exit_ov2722);
module_i2c_driver(ov2722_driver);
MODULE_AUTHOR("Wei Liu <wei.liu@intel.com>");
MODULE_DESCRIPTION("A low-level driver for OmniVision 2722 sensors");
......
......@@ -2038,20 +2038,7 @@ static struct i2c_driver ov5693_driver = {
.remove = ov5693_remove,
.id_table = ov5693_id,
};
static int init_ov5693(void)
{
return i2c_add_driver(&ov5693_driver);
}
static void exit_ov5693(void)
{
i2c_del_driver(&ov5693_driver);
}
module_init(init_ov5693);
module_exit(exit_ov5693);
module_i2c_driver(ov5693_driver);
MODULE_DESCRIPTION("A low-level driver for OmniVision 5693 sensors");
MODULE_LICENSE("GPL");
......@@ -2199,19 +2199,7 @@ static struct i2c_driver ov8858_driver = {
.remove = ov8858_remove,
.id_table = ov8858_id,
};
static __init int ov8858_init_mod(void)
{
return i2c_add_driver(&ov8858_driver);
}
static __exit void ov8858_exit_mod(void)
{
i2c_del_driver(&ov8858_driver);
}
module_init(ov8858_init_mod);
module_exit(ov8858_exit_mod);
module_i2c_driver(ov8858_driver);
MODULE_DESCRIPTION("A low-level driver for Omnivision OV8858 sensors");
MODULE_LICENSE("GPL");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment