Skip to content

Commit

Permalink
drivers: Use module_i2c_driver() and module_platform_driver()
Browse files Browse the repository at this point in the history
  • Loading branch information
sirmordred committed Jun 9, 2015
1 parent c0d2df1 commit e2409f0
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 68 deletions.
16 changes: 1 addition & 15 deletions drivers/i2c/chips/fsa9480.c
Original file line number Diff line number Diff line change
Expand Up @@ -1341,24 +1341,10 @@ static struct i2c_driver fsa9480_driver = {
},
};

static int __init fsa9480_init(void)
{
printk("[FSA9480] fsa9480_init \n");

return i2c_add_driver(&fsa9480_driver);
}

static void __exit fsa9480_exit(void)
{
i2c_del_driver(&fsa9480_driver);
}


EXPORT_SYMBOL(fsa9480_i2c_read);
EXPORT_SYMBOL(fsa9480_i2c_write);

module_init(fsa9480_init);
module_exit(fsa9480_exit);
module_i2c_driver(fsa9480_driver);

MODULE_AUTHOR("");
MODULE_DESCRIPTION("fsa9480 Driver");
Expand Down
14 changes: 1 addition & 13 deletions drivers/i2c/chips/yda165.c
Original file line number Diff line number Diff line change
Expand Up @@ -1709,19 +1709,7 @@ static struct i2c_driver yda165_driver = {
},
};

static int __init yda165_init(void)
{
pr_info(MODULE_NAME ":%s\n",__func__);
return i2c_add_driver(&yda165_driver);
}

static void __exit yda165_exit(void)
{
i2c_del_driver(&yda165_driver);
}

module_init(yda165_init);
module_exit(yda165_exit);
module_i2c_driver(yda165_driver);

MODULE_AUTHOR("Jongcheol Park");
MODULE_DESCRIPTION("YDA165 Driver");
Expand Down
13 changes: 1 addition & 12 deletions drivers/power/smb328a_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -1119,18 +1119,7 @@ static struct i2c_driver smb328a_i2c_driver = {
.id_table = smb328a_id,
};

static int __init smb328a_init(void)
{
return i2c_add_driver(&smb328a_i2c_driver);
}
module_init(smb328a_init);

static void __exit smb328a_exit(void)
{
i2c_del_driver(&smb328a_i2c_driver);
}
module_exit(smb328a_exit);

module_i2c_driver(smb328a_i2c_driver);

MODULE_DESCRIPTION("SMB328A charger control driver");
MODULE_AUTHOR("<jongmyeong.ko@samsung.com>");
Expand Down
13 changes: 1 addition & 12 deletions drivers/sensors_ancora/ak8975.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,18 +432,7 @@ static struct i2c_driver akm8975_driver = {
},
};

static int __init akm8975_init(void)
{
return i2c_add_driver(&akm8975_driver);
}

static void __exit akm8975_exit(void)
{
i2c_del_driver(&akm8975_driver);
}

module_init(akm8975_init);
module_exit(akm8975_exit);
module_i2c_driver(akm8975_driver);

MODULE_DESCRIPTION("AKM8975 compass driver");
MODULE_LICENSE("GPL");
Expand Down
17 changes: 1 addition & 16 deletions drivers/sensors_ancora/gp2a_proximity.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,22 +716,7 @@ static struct platform_driver gp2a_opt_driver = {
},
};

static int __init gp2a_opt_init(void)
{
int ret;

ret = platform_driver_register(&gp2a_opt_driver);
return ret;


}
static void __exit gp2a_opt_exit(void)
{
platform_driver_unregister(&gp2a_opt_driver);
}

module_init( gp2a_opt_init );
module_exit( gp2a_opt_exit );
module_platform_driver(gp2a_opt_driver);

MODULE_AUTHOR("SAMSUNG");
MODULE_DESCRIPTION("Optical Sensor driver for GP2AP002A00F");
Expand Down

0 comments on commit e2409f0

Please sign in to comment.