* [PATCH 1/1] mfd: menelaus: Use module_i2c_driver
@ 2014-05-29 11:43 Sachin Kamat
2014-05-29 12:02 ` Lee Jones
0 siblings, 1 reply; 2+ messages in thread
From: Sachin Kamat @ 2014-05-29 11:43 UTC (permalink / raw)
To: linux-kernel; +Cc: lee.jones, sachin.kamat
module_i2c_driver simplifies the code by eliminating
boilerplate code.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
drivers/mfd/menelaus.c | 23 +----------------------
1 file changed, 1 insertion(+), 22 deletions(-)
diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
index ad25bfa3fb02..5e2667afe2bc 100644
--- a/drivers/mfd/menelaus.c
+++ b/drivers/mfd/menelaus.c
@@ -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);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] mfd: menelaus: Use module_i2c_driver
2014-05-29 11:43 [PATCH 1/1] mfd: menelaus: Use module_i2c_driver Sachin Kamat
@ 2014-05-29 12:02 ` Lee Jones
0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2014-05-29 12:02 UTC (permalink / raw)
To: Sachin Kamat; +Cc: linux-kernel
> module_i2c_driver simplifies the code by eliminating
> boilerplate code.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
> drivers/mfd/menelaus.c | 23 +----------------------
> 1 file changed, 1 insertion(+), 22 deletions(-)
Applied, thanks.
> diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
> index ad25bfa3fb02..5e2667afe2bc 100644
> --- a/drivers/mfd/menelaus.c
> +++ b/drivers/mfd/menelaus.c
> @@ -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);
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-05-29 12:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-29 11:43 [PATCH 1/1] mfd: menelaus: Use module_i2c_driver Sachin Kamat
2014-05-29 12:02 ` Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox