diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-09-22 18:32:08 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-09-22 18:38:04 -0400 |
commit | 8fed54aec8fa5bc6ebfee95454a2cb33101ad917 (patch) | |
tree | 1823238681e18a501b0643b9d69332ab66afcdd5 | |
parent | ddfb43f3881edb47aa0083651ad31983cdc42c33 (diff) |
ASoC: wm2000: Convert to devm_regmap_init_i2c()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | sound/soc/codecs/wm2000.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/sound/soc/codecs/wm2000.c b/sound/soc/codecs/wm2000.c index 89cd6fcad015..6675477a63cb 100644 --- a/sound/soc/codecs/wm2000.c +++ b/sound/soc/codecs/wm2000.c | |||
@@ -760,7 +760,7 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c, | |||
760 | 760 | ||
761 | dev_set_drvdata(&i2c->dev, wm2000); | 761 | dev_set_drvdata(&i2c->dev, wm2000); |
762 | 762 | ||
763 | wm2000->regmap = regmap_init_i2c(i2c, &wm2000_regmap); | 763 | wm2000->regmap = devm_regmap_init_i2c(i2c, &wm2000_regmap); |
764 | if (IS_ERR(wm2000->regmap)) { | 764 | if (IS_ERR(wm2000->regmap)) { |
765 | ret = PTR_ERR(wm2000->regmap); | 765 | ret = PTR_ERR(wm2000->regmap); |
766 | dev_err(&i2c->dev, "Failed to allocate register map: %d\n", | 766 | dev_err(&i2c->dev, "Failed to allocate register map: %d\n", |
@@ -777,7 +777,7 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c, | |||
777 | if (id != 0x2000) { | 777 | if (id != 0x2000) { |
778 | dev_err(&i2c->dev, "Device is not a WM2000 - ID %x\n", id); | 778 | dev_err(&i2c->dev, "Device is not a WM2000 - ID %x\n", id); |
779 | ret = -ENODEV; | 779 | ret = -ENODEV; |
780 | goto out_regmap_exit; | 780 | goto out; |
781 | } | 781 | } |
782 | 782 | ||
783 | reg = wm2000_read(i2c, WM2000_REG_REVISON); | 783 | reg = wm2000_read(i2c, WM2000_REG_REVISON); |
@@ -796,7 +796,7 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c, | |||
796 | ret = request_firmware(&fw, filename, &i2c->dev); | 796 | ret = request_firmware(&fw, filename, &i2c->dev); |
797 | if (ret != 0) { | 797 | if (ret != 0) { |
798 | dev_err(&i2c->dev, "Failed to acquire ANC data: %d\n", ret); | 798 | dev_err(&i2c->dev, "Failed to acquire ANC data: %d\n", ret); |
799 | goto out_regmap_exit; | 799 | goto out; |
800 | } | 800 | } |
801 | 801 | ||
802 | /* Pre-cook the concatenation of the register address onto the image */ | 802 | /* Pre-cook the concatenation of the register address onto the image */ |
@@ -807,7 +807,7 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c, | |||
807 | if (wm2000->anc_download == NULL) { | 807 | if (wm2000->anc_download == NULL) { |
808 | dev_err(&i2c->dev, "Out of memory\n"); | 808 | dev_err(&i2c->dev, "Out of memory\n"); |
809 | ret = -ENOMEM; | 809 | ret = -ENOMEM; |
810 | goto out_regmap_exit; | 810 | goto out; |
811 | } | 811 | } |
812 | 812 | ||
813 | wm2000->anc_download[0] = 0x80; | 813 | wm2000->anc_download[0] = 0x80; |
@@ -825,8 +825,6 @@ static int __devinit wm2000_i2c_probe(struct i2c_client *i2c, | |||
825 | if (!ret) | 825 | if (!ret) |
826 | goto out; | 826 | goto out; |
827 | 827 | ||
828 | out_regmap_exit: | ||
829 | regmap_exit(wm2000->regmap); | ||
830 | out: | 828 | out: |
831 | release_firmware(fw); | 829 | release_firmware(fw); |
832 | return ret; | 830 | return ret; |
@@ -834,10 +832,7 @@ out: | |||
834 | 832 | ||
835 | static __devexit int wm2000_i2c_remove(struct i2c_client *i2c) | 833 | static __devexit int wm2000_i2c_remove(struct i2c_client *i2c) |
836 | { | 834 | { |
837 | struct wm2000_priv *wm2000 = dev_get_drvdata(&i2c->dev); | ||
838 | |||
839 | snd_soc_unregister_codec(&i2c->dev); | 835 | snd_soc_unregister_codec(&i2c->dev); |
840 | regmap_exit(wm2000->regmap); | ||
841 | 836 | ||
842 | return 0; | 837 | return 0; |
843 | } | 838 | } |