2013-03-12 13:36:27

by Wei Yongjun

[permalink] [raw]
Subject: [PATCH -next] ASoC: tas5086: 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.

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

diff --git a/sound/soc/codecs/tas5086.c b/sound/soc/codecs/tas5086.c
index 008bea4..40cee84 100644
--- a/sound/soc/codecs/tas5086.c
+++ b/sound/soc/codecs/tas5086.c
@@ -584,17 +584,7 @@ static struct i2c_driver tas5086_i2c_driver = {
.remove = tas5086_i2c_remove,
};

-static int __init tas5086_modinit(void)
-{
- return i2c_add_driver(&tas5086_i2c_driver);
-}
-module_init(tas5086_modinit);
-
-static void __exit tas5086_modexit(void)
-{
- i2c_del_driver(&tas5086_i2c_driver);
-}
-module_exit(tas5086_modexit);
+module_i2c_driver(tas5086_i2c_driver);

MODULE_AUTHOR("Daniel Mack <[email protected]>");
MODULE_DESCRIPTION("Texas Instruments TAS5086 ALSA SoC Codec Driver");


2013-03-12 13:40:36

by Daniel Mack

[permalink] [raw]
Subject: Re: [PATCH -next] ASoC: tas5086: use module_i2c_driver to simplify the code

On 12.03.2013 14:36, Wei Yongjun wrote:
> From: Wei Yongjun <[email protected]>
>
> Use the module_i2c_driver() macro to make the code smaller
> and a bit simpler.

Thanks for catching this!

> Signed-off-by: Wei Yongjun <[email protected]>

Acked-by: Daniel Mack <[email protected]>



> ---
> sound/soc/codecs/tas5086.c | 12 +-----------
> 1 file changed, 1 insertion(+), 11 deletions(-)
>
> diff --git a/sound/soc/codecs/tas5086.c b/sound/soc/codecs/tas5086.c
> index 008bea4..40cee84 100644
> --- a/sound/soc/codecs/tas5086.c
> +++ b/sound/soc/codecs/tas5086.c
> @@ -584,17 +584,7 @@ static struct i2c_driver tas5086_i2c_driver = {
> .remove = tas5086_i2c_remove,
> };
>
> -static int __init tas5086_modinit(void)
> -{
> - return i2c_add_driver(&tas5086_i2c_driver);
> -}
> -module_init(tas5086_modinit);
> -
> -static void __exit tas5086_modexit(void)
> -{
> - i2c_del_driver(&tas5086_i2c_driver);
> -}
> -module_exit(tas5086_modexit);
> +module_i2c_driver(tas5086_i2c_driver);
>
> MODULE_AUTHOR("Daniel Mack <[email protected]>");
> MODULE_DESCRIPTION("Texas Instruments TAS5086 ALSA SoC Codec Driver");
>
>

2013-03-12 18:17:33

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH -next] ASoC: tas5086: use module_i2c_driver to simplify the code

On Tue, Mar 12, 2013 at 09:36:24PM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <[email protected]>
>
> Use the module_i2c_driver() macro to make the code smaller
> and a bit simpler.

Applied, thanks.


Attachments:
(No filename) (216.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments