diff options
Diffstat (limited to 'sound/soc/codecs/wm8955.c')
-rw-r--r-- | sound/soc/codecs/wm8955.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/sound/soc/codecs/wm8955.c b/sound/soc/codecs/wm8955.c index fecd4e4f4c57..2a35108f233d 100644 --- a/sound/soc/codecs/wm8955.c +++ b/sound/soc/codecs/wm8955.c | |||
@@ -390,7 +390,7 @@ static int wm8955_set_deemph(struct snd_soc_codec *codec) | |||
390 | static int wm8955_get_deemph(struct snd_kcontrol *kcontrol, | 390 | static int wm8955_get_deemph(struct snd_kcontrol *kcontrol, |
391 | struct snd_ctl_elem_value *ucontrol) | 391 | struct snd_ctl_elem_value *ucontrol) |
392 | { | 392 | { |
393 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 393 | struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); |
394 | struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec); | 394 | struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec); |
395 | 395 | ||
396 | ucontrol->value.enumerated.item[0] = wm8955->deemph; | 396 | ucontrol->value.enumerated.item[0] = wm8955->deemph; |
@@ -400,7 +400,7 @@ static int wm8955_get_deemph(struct snd_kcontrol *kcontrol, | |||
400 | static int wm8955_put_deemph(struct snd_kcontrol *kcontrol, | 400 | static int wm8955_put_deemph(struct snd_kcontrol *kcontrol, |
401 | struct snd_ctl_elem_value *ucontrol) | 401 | struct snd_ctl_elem_value *ucontrol) |
402 | { | 402 | { |
403 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 403 | struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); |
404 | struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec); | 404 | struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec); |
405 | int deemph = ucontrol->value.enumerated.item[0]; | 405 | int deemph = ucontrol->value.enumerated.item[0]; |
406 | 406 | ||
@@ -898,7 +898,7 @@ static int wm8955_probe(struct snd_soc_codec *codec) | |||
898 | for (i = 0; i < ARRAY_SIZE(wm8955->supplies); i++) | 898 | for (i = 0; i < ARRAY_SIZE(wm8955->supplies); i++) |
899 | wm8955->supplies[i].supply = wm8955_supply_names[i]; | 899 | wm8955->supplies[i].supply = wm8955_supply_names[i]; |
900 | 900 | ||
901 | ret = regulator_bulk_get(codec->dev, ARRAY_SIZE(wm8955->supplies), | 901 | ret = devm_regulator_bulk_get(codec->dev, ARRAY_SIZE(wm8955->supplies), |
902 | wm8955->supplies); | 902 | wm8955->supplies); |
903 | if (ret != 0) { | 903 | if (ret != 0) { |
904 | dev_err(codec->dev, "Failed to request supplies: %d\n", ret); | 904 | dev_err(codec->dev, "Failed to request supplies: %d\n", ret); |
@@ -909,7 +909,7 @@ static int wm8955_probe(struct snd_soc_codec *codec) | |||
909 | wm8955->supplies); | 909 | wm8955->supplies); |
910 | if (ret != 0) { | 910 | if (ret != 0) { |
911 | dev_err(codec->dev, "Failed to enable supplies: %d\n", ret); | 911 | dev_err(codec->dev, "Failed to enable supplies: %d\n", ret); |
912 | goto err_get; | 912 | return ret; |
913 | } | 913 | } |
914 | 914 | ||
915 | ret = wm8955_reset(codec); | 915 | ret = wm8955_reset(codec); |
@@ -961,17 +961,12 @@ static int wm8955_probe(struct snd_soc_codec *codec) | |||
961 | 961 | ||
962 | err_enable: | 962 | err_enable: |
963 | regulator_bulk_disable(ARRAY_SIZE(wm8955->supplies), wm8955->supplies); | 963 | regulator_bulk_disable(ARRAY_SIZE(wm8955->supplies), wm8955->supplies); |
964 | err_get: | ||
965 | regulator_bulk_free(ARRAY_SIZE(wm8955->supplies), wm8955->supplies); | ||
966 | return ret; | 964 | return ret; |
967 | } | 965 | } |
968 | 966 | ||
969 | static int wm8955_remove(struct snd_soc_codec *codec) | 967 | static int wm8955_remove(struct snd_soc_codec *codec) |
970 | { | 968 | { |
971 | struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec); | ||
972 | |||
973 | wm8955_set_bias_level(codec, SND_SOC_BIAS_OFF); | 969 | wm8955_set_bias_level(codec, SND_SOC_BIAS_OFF); |
974 | regulator_bulk_free(ARRAY_SIZE(wm8955->supplies), wm8955->supplies); | ||
975 | return 0; | 970 | return 0; |
976 | } | 971 | } |
977 | 972 | ||