diff options
Diffstat (limited to 'sound/soc/codecs/wm8955.c')
-rw-r--r-- | sound/soc/codecs/wm8955.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8955.c b/sound/soc/codecs/wm8955.c index fedb76452f1b..5f025593d84d 100644 --- a/sound/soc/codecs/wm8955.c +++ b/sound/soc/codecs/wm8955.c | |||
@@ -964,7 +964,8 @@ static int wm8955_register(struct wm8955_priv *wm8955, | |||
964 | 964 | ||
965 | if (wm8955_codec) { | 965 | if (wm8955_codec) { |
966 | dev_err(codec->dev, "Another WM8955 is registered\n"); | 966 | dev_err(codec->dev, "Another WM8955 is registered\n"); |
967 | return -EINVAL; | 967 | ret = -EINVAL; |
968 | goto err; | ||
968 | } | 969 | } |
969 | 970 | ||
970 | mutex_init(&codec->mutex); | 971 | mutex_init(&codec->mutex); |
@@ -1047,18 +1048,19 @@ static int wm8955_register(struct wm8955_priv *wm8955, | |||
1047 | ret = snd_soc_register_codec(codec); | 1048 | ret = snd_soc_register_codec(codec); |
1048 | if (ret != 0) { | 1049 | if (ret != 0) { |
1049 | dev_err(codec->dev, "Failed to register codec: %d\n", ret); | 1050 | dev_err(codec->dev, "Failed to register codec: %d\n", ret); |
1050 | return ret; | 1051 | goto err_enable; |
1051 | } | 1052 | } |
1052 | 1053 | ||
1053 | ret = snd_soc_register_dai(&wm8955_dai); | 1054 | ret = snd_soc_register_dai(&wm8955_dai); |
1054 | if (ret != 0) { | 1055 | if (ret != 0) { |
1055 | dev_err(codec->dev, "Failed to register DAI: %d\n", ret); | 1056 | dev_err(codec->dev, "Failed to register DAI: %d\n", ret); |
1056 | snd_soc_unregister_codec(codec); | 1057 | goto err_codec; |
1057 | return ret; | ||
1058 | } | 1058 | } |
1059 | 1059 | ||
1060 | return 0; | 1060 | return 0; |
1061 | 1061 | ||
1062 | err_codec: | ||
1063 | snd_soc_unregister_codec(codec); | ||
1062 | err_enable: | 1064 | err_enable: |
1063 | regulator_bulk_disable(ARRAY_SIZE(wm8955->supplies), wm8955->supplies); | 1065 | regulator_bulk_disable(ARRAY_SIZE(wm8955->supplies), wm8955->supplies); |
1064 | err_get: | 1066 | err_get: |