aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTushar Behera <tushar.behera@linaro.org>2012-11-21 23:08:41 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-11-23 09:36:37 -0500
commit28517f5cf6bb4c12bf03f4b8bbdf875398634410 (patch)
tree9cf67fd6744bf937f056d3d4333e04d53caee8bc
parentf4a75d2eb7b1e2206094b901be09adb31ba63681 (diff)
ASoC: wm8988: Convert to use devm_regmap_init_{spi,i2c}()
Signed-off-by: Tushar Behera <tushar.behera@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/codecs/wm8988.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/sound/soc/codecs/wm8988.c b/sound/soc/codecs/wm8988.c
index 1d4c5cf47b06..715788de442e 100644
--- a/sound/soc/codecs/wm8988.c
+++ b/sound/soc/codecs/wm8988.c
@@ -882,7 +882,7 @@ static int __devinit wm8988_spi_probe(struct spi_device *spi)
882 if (wm8988 == NULL) 882 if (wm8988 == NULL)
883 return -ENOMEM; 883 return -ENOMEM;
884 884
885 wm8988->regmap = regmap_init_spi(spi, &wm8988_regmap); 885 wm8988->regmap = devm_regmap_init_spi(spi, &wm8988_regmap);
886 if (IS_ERR(wm8988->regmap)) { 886 if (IS_ERR(wm8988->regmap)) {
887 ret = PTR_ERR(wm8988->regmap); 887 ret = PTR_ERR(wm8988->regmap);
888 dev_err(&spi->dev, "Failed to init regmap: %d\n", ret); 888 dev_err(&spi->dev, "Failed to init regmap: %d\n", ret);
@@ -893,17 +893,12 @@ static int __devinit wm8988_spi_probe(struct spi_device *spi)
893 893
894 ret = snd_soc_register_codec(&spi->dev, 894 ret = snd_soc_register_codec(&spi->dev,
895 &soc_codec_dev_wm8988, &wm8988_dai, 1); 895 &soc_codec_dev_wm8988, &wm8988_dai, 1);
896 if (ret != 0)
897 regmap_exit(wm8988->regmap);
898
899 return ret; 896 return ret;
900} 897}
901 898
902static int __devexit wm8988_spi_remove(struct spi_device *spi) 899static int __devexit wm8988_spi_remove(struct spi_device *spi)
903{ 900{
904 struct wm8988_priv *wm8988 = spi_get_drvdata(spi);
905 snd_soc_unregister_codec(&spi->dev); 901 snd_soc_unregister_codec(&spi->dev);
906 regmap_exit(wm8988->regmap);
907 return 0; 902 return 0;
908} 903}
909 904
@@ -931,7 +926,7 @@ static __devinit int wm8988_i2c_probe(struct i2c_client *i2c,
931 926
932 i2c_set_clientdata(i2c, wm8988); 927 i2c_set_clientdata(i2c, wm8988);
933 928
934 wm8988->regmap = regmap_init_i2c(i2c, &wm8988_regmap); 929 wm8988->regmap = devm_regmap_init_i2c(i2c, &wm8988_regmap);
935 if (IS_ERR(wm8988->regmap)) { 930 if (IS_ERR(wm8988->regmap)) {
936 ret = PTR_ERR(wm8988->regmap); 931 ret = PTR_ERR(wm8988->regmap);
937 dev_err(&i2c->dev, "Failed to init regmap: %d\n", ret); 932 dev_err(&i2c->dev, "Failed to init regmap: %d\n", ret);
@@ -940,17 +935,12 @@ static __devinit int wm8988_i2c_probe(struct i2c_client *i2c,
940 935
941 ret = snd_soc_register_codec(&i2c->dev, 936 ret = snd_soc_register_codec(&i2c->dev,
942 &soc_codec_dev_wm8988, &wm8988_dai, 1); 937 &soc_codec_dev_wm8988, &wm8988_dai, 1);
943 if (ret != 0)
944 regmap_exit(wm8988->regmap);
945
946 return ret; 938 return ret;
947} 939}
948 940
949static __devexit int wm8988_i2c_remove(struct i2c_client *client) 941static __devexit int wm8988_i2c_remove(struct i2c_client *client)
950{ 942{
951 struct wm8988_priv *wm8988 = i2c_get_clientdata(client);
952 snd_soc_unregister_codec(&client->dev); 943 snd_soc_unregister_codec(&client->dev);
953 regmap_exit(wm8988->regmap);
954 return 0; 944 return 0;
955} 945}
956 946