All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ASoC: alc5623: Convert to module_i2c_driver()
@ 2012-05-08 15:42 Axel Lin
  2012-05-08 15:43 ` [PATCH 2/3] ASoC: alc5632: " Axel Lin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Axel Lin @ 2012-05-08 15:42 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown, Liam Girdwood, Arnaud Patard

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 sound/soc/codecs/alc5623.c |   20 +-------------------
 1 files changed, 1 insertions(+), 19 deletions(-)

diff --git a/sound/soc/codecs/alc5623.c b/sound/soc/codecs/alc5623.c
index 3061d35..1960478 100644
--- a/sound/soc/codecs/alc5623.c
+++ b/sound/soc/codecs/alc5623.c
@@ -1083,25 +1083,7 @@ static struct i2c_driver alc5623_i2c_driver = {
 	.id_table = alc5623_i2c_table,
 };
 
-static int __init alc5623_modinit(void)
-{
-	int ret;
-
-	ret = i2c_add_driver(&alc5623_i2c_driver);
-	if (ret != 0) {
-		printk(KERN_ERR "%s: can't add i2c driver", __func__);
-		return ret;
-	}
-
-	return ret;
-}
-module_init(alc5623_modinit);
-
-static void __exit alc5623_modexit(void)
-{
-	i2c_del_driver(&alc5623_i2c_driver);
-}
-module_exit(alc5623_modexit);
+module_i2c_driver(alc5623_i2c_driver);
 
 MODULE_DESCRIPTION("ASoC alc5621/2/3 driver");
 MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>");
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] ASoC: alc5632: Convert to module_i2c_driver()
  2012-05-08 15:42 [PATCH 1/3] ASoC: alc5623: Convert to module_i2c_driver() Axel Lin
@ 2012-05-08 15:43 ` Axel Lin
  2012-05-08 15:44 ` [PATCH 3/3] ASoC: alc5632: Convert to devm_regmap_init_i2c() Axel Lin
  2012-05-08 17:46 ` [PATCH 1/3] ASoC: alc5623: Convert to module_i2c_driver() Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Axel Lin @ 2012-05-08 15:43 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown, Andrey Danin, Liam, Leon Romanovsky, Girdwood

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 sound/soc/codecs/alc5632.c |   20 +-------------------
 1 files changed, 1 insertions(+), 19 deletions(-)

diff --git a/sound/soc/codecs/alc5632.c b/sound/soc/codecs/alc5632.c
index 93a5909..b29a53b 100644
--- a/sound/soc/codecs/alc5632.c
+++ b/sound/soc/codecs/alc5632.c
@@ -1208,25 +1208,7 @@ static struct i2c_driver alc5632_i2c_driver = {
 	.id_table = alc5632_i2c_table,
 };
 
-static int __init alc5632_modinit(void)
-{
-	int ret;
-
-	ret = i2c_add_driver(&alc5632_i2c_driver);
-	if (ret != 0) {
-		printk(KERN_ERR "%s: can't add i2c driver", __func__);
-		return ret;
-	}
-
-	return ret;
-}
-module_init(alc5632_modinit);
-
-static void __exit alc5632_modexit(void)
-{
-	i2c_del_driver(&alc5632_i2c_driver);
-}
-module_exit(alc5632_modexit);
+module_i2c_driver(alc5632_i2c_driver);
 
 MODULE_DESCRIPTION("ASoC ALC5632 driver");
 MODULE_AUTHOR("Leon Romanovsky <leon@leon.nu>");
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] ASoC: alc5632: Convert to devm_regmap_init_i2c()
  2012-05-08 15:42 [PATCH 1/3] ASoC: alc5623: Convert to module_i2c_driver() Axel Lin
  2012-05-08 15:43 ` [PATCH 2/3] ASoC: alc5632: " Axel Lin
@ 2012-05-08 15:44 ` Axel Lin
  2012-05-08 17:46 ` [PATCH 1/3] ASoC: alc5623: Convert to module_i2c_driver() Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Axel Lin @ 2012-05-08 15:44 UTC (permalink / raw)
  To: alsa-devel; +Cc: Andrey Danin, Mark Brown, Leon Romanovsky, Liam Girdwood

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 sound/soc/codecs/alc5632.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/sound/soc/codecs/alc5632.c b/sound/soc/codecs/alc5632.c
index b29a53b..7dd0242 100644
--- a/sound/soc/codecs/alc5632.c
+++ b/sound/soc/codecs/alc5632.c
@@ -1130,7 +1130,7 @@ static __devinit int alc5632_i2c_probe(struct i2c_client *client,
 
 	i2c_set_clientdata(client, alc5632);
 
-	alc5632->regmap = regmap_init_i2c(client, &alc5632_regmap);
+	alc5632->regmap = devm_regmap_init_i2c(client, &alc5632_regmap);
 	if (IS_ERR(alc5632->regmap)) {
 		ret = PTR_ERR(alc5632->regmap);
 		dev_err(&client->dev, "regmap_init() failed: %d\n", ret);
@@ -1142,7 +1142,6 @@ static __devinit int alc5632_i2c_probe(struct i2c_client *client,
 	if (ret1 != 0 || ret2 != 0) {
 		dev_err(&client->dev,
 		"Failed to read chip ID: ret1=%d, ret2=%d\n", ret1, ret2);
-		regmap_exit(alc5632->regmap);
 		return -EIO;
 	}
 
@@ -1151,14 +1150,12 @@ static __devinit int alc5632_i2c_probe(struct i2c_client *client,
 	if ((vid1 != 0x10EC) || (vid2 != id->driver_data)) {
 		dev_err(&client->dev,
 		"Device is not a ALC5632: VID1=0x%x, VID2=0x%x\n", vid1, vid2);
-		regmap_exit(alc5632->regmap);
 		return -EINVAL;
 	}
 
 	ret = alc5632_reset(alc5632->regmap);
 	if (ret < 0) {
 		dev_err(&client->dev, "Failed to issue reset\n");
-		regmap_exit(alc5632->regmap);
 		return ret;
 	}
 
@@ -1176,7 +1173,6 @@ static __devinit int alc5632_i2c_probe(struct i2c_client *client,
 
 	if (ret < 0) {
 		dev_err(&client->dev, "Failed to register codec: %d\n", ret);
-		regmap_exit(alc5632->regmap);
 		return ret;
 	}
 
@@ -1185,9 +1181,7 @@ static __devinit int alc5632_i2c_probe(struct i2c_client *client,
 
 static __devexit int alc5632_i2c_remove(struct i2c_client *client)
 {
-	struct alc5632_priv *alc5632 = i2c_get_clientdata(client);
 	snd_soc_unregister_codec(&client->dev);
-	regmap_exit(alc5632->regmap);
 	return 0;
 }
 
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] ASoC: alc5623: Convert to module_i2c_driver()
  2012-05-08 15:42 [PATCH 1/3] ASoC: alc5623: Convert to module_i2c_driver() Axel Lin
  2012-05-08 15:43 ` [PATCH 2/3] ASoC: alc5632: " Axel Lin
  2012-05-08 15:44 ` [PATCH 3/3] ASoC: alc5632: Convert to devm_regmap_init_i2c() Axel Lin
@ 2012-05-08 17:46 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2012-05-08 17:46 UTC (permalink / raw)
  To: Axel Lin; +Cc: alsa-devel, Liam Girdwood, Arnaud Patard


[-- Attachment #1.1: Type: text/plain, Size: 127 bytes --]

On Tue, May 08, 2012 at 11:42:23PM +0800, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Applied all, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-05-08 17:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-08 15:42 [PATCH 1/3] ASoC: alc5623: Convert to module_i2c_driver() Axel Lin
2012-05-08 15:43 ` [PATCH 2/3] ASoC: alc5632: " Axel Lin
2012-05-08 15:44 ` [PATCH 3/3] ASoC: alc5632: Convert to devm_regmap_init_i2c() Axel Lin
2012-05-08 17:46 ` [PATCH 1/3] ASoC: alc5623: Convert to module_i2c_driver() Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.