2012-10-08 14:09:52

by Wei Yongjun

[permalink] [raw]
Subject: [PATCH] mfd: use module_i2c_driver to simplify the code

From: Wei Yongjun <[email protected]>

Use the module_i2c_driver() macro to make the code smaller
and a bit simpler.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <[email protected]>
---
drivers/mfd/adp5520.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/mfd/adp5520.c b/drivers/mfd/adp5520.c
index ea8b947..94e7a6d 100644
--- a/drivers/mfd/adp5520.c
+++ b/drivers/mfd/adp5520.c
@@ -360,17 +360,7 @@ static struct i2c_driver adp5520_driver = {
.id_table = adp5520_id,
};

-static int __init adp5520_init(void)
-{
- return i2c_add_driver(&adp5520_driver);
-}
-module_init(adp5520_init);
-
-static void __exit adp5520_exit(void)
-{
- i2c_del_driver(&adp5520_driver);
-}
-module_exit(adp5520_exit);
+module_i2c_driver(adp5520_driver);

MODULE_AUTHOR("Michael Hennerich <[email protected]>");
MODULE_DESCRIPTION("ADP5520(01) PMIC-MFD Driver");


2012-10-09 07:47:07

by Hennerich, Michael

[permalink] [raw]
Subject: Re: [PATCH] mfd: use module_i2c_driver to simplify the code

On 10/08/2012 04:09 PM, Wei Yongjun wrote:
> From: Wei Yongjun <[email protected]>
>
> Use the module_i2c_driver() macro to make the code smaller
> and a bit simpler.
>
> dpatch engine is used to auto generate this patch.
> (https://github.com/weiyj/dpatch)
>
> Signed-off-by: Wei Yongjun <[email protected]>
Acked-by: Michael Hennerich <[email protected]>
> ---
> drivers/mfd/adp5520.c | 12 +-----------
> 1 file changed, 1 insertion(+), 11 deletions(-)
>
> diff --git a/drivers/mfd/adp5520.c b/drivers/mfd/adp5520.c
> index ea8b947..94e7a6d 100644
> --- a/drivers/mfd/adp5520.c
> +++ b/drivers/mfd/adp5520.c
> @@ -360,17 +360,7 @@ static struct i2c_driver adp5520_driver = {
> .id_table = adp5520_id,
> };
>
> -static int __init adp5520_init(void)
> -{
> - return i2c_add_driver(&adp5520_driver);
> -}
> -module_init(adp5520_init);
> -
> -static void __exit adp5520_exit(void)
> -{
> - i2c_del_driver(&adp5520_driver);
> -}
> -module_exit(adp5520_exit);
> +module_i2c_driver(adp5520_driver);
>
> MODULE_AUTHOR("Michael Hennerich <[email protected]>");
> MODULE_DESCRIPTION("ADP5520(01) PMIC-MFD Driver");
>
>


--
Greetings,
Michael

--
Analog Devices GmbH Wilhelm-Wagenfeld-Str. 6 80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
Margaret Seif