Skip to content

Commit

Permalink
mfd: menelaus: Use module_i2c_driver
Browse files Browse the repository at this point in the history
module_i2c_driver simplifies the code by eliminating
boilerplate code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
  • Loading branch information
Sachin Kamat authored and Lee Jones committed Jun 3, 2014
1 parent 8320513 commit 1d3c7f5
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions drivers/mfd/menelaus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1287,29 +1287,8 @@ static struct i2c_driver menelaus_i2c_driver = {
.id_table = menelaus_id,
};

static int __init menelaus_init(void)
{
int res;

res = i2c_add_driver(&menelaus_i2c_driver);
if (res < 0) {
pr_err(DRIVER_NAME ": driver registration failed\n");
return res;
}

return 0;
}

static void __exit menelaus_exit(void)
{
i2c_del_driver(&menelaus_i2c_driver);

/* FIXME: Shutdown menelaus parts that can be shut down */
}
module_i2c_driver(menelaus_i2c_driver);

MODULE_AUTHOR("Texas Instruments, Inc. (and others)");
MODULE_DESCRIPTION("I2C interface for Menelaus.");
MODULE_LICENSE("GPL");

module_init(menelaus_init);
module_exit(menelaus_exit);

0 comments on commit 1d3c7f5

Please sign in to comment.