diff options
Diffstat (limited to 'sound/soc/codecs/wm8961.c')
-rw-r--r-- | sound/soc/codecs/wm8961.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8961.c b/sound/soc/codecs/wm8961.c index 5b9a756242f1..2549d3a297ab 100644 --- a/sound/soc/codecs/wm8961.c +++ b/sound/soc/codecs/wm8961.c | |||
@@ -1102,7 +1102,7 @@ static int wm8961_register(struct wm8961_priv *wm8961) | |||
1102 | ret = wm8961_reset(codec); | 1102 | ret = wm8961_reset(codec); |
1103 | if (ret < 0) { | 1103 | if (ret < 0) { |
1104 | dev_err(codec->dev, "Failed to issue reset\n"); | 1104 | dev_err(codec->dev, "Failed to issue reset\n"); |
1105 | return ret; | 1105 | goto err; |
1106 | } | 1106 | } |
1107 | 1107 | ||
1108 | /* Enable class W */ | 1108 | /* Enable class W */ |
@@ -1147,18 +1147,19 @@ static int wm8961_register(struct wm8961_priv *wm8961) | |||
1147 | ret = snd_soc_register_codec(codec); | 1147 | ret = snd_soc_register_codec(codec); |
1148 | if (ret != 0) { | 1148 | if (ret != 0) { |
1149 | dev_err(codec->dev, "Failed to register codec: %d\n", ret); | 1149 | dev_err(codec->dev, "Failed to register codec: %d\n", ret); |
1150 | return ret; | 1150 | goto err; |
1151 | } | 1151 | } |
1152 | 1152 | ||
1153 | ret = snd_soc_register_dai(&wm8961_dai); | 1153 | ret = snd_soc_register_dai(&wm8961_dai); |
1154 | if (ret != 0) { | 1154 | if (ret != 0) { |
1155 | dev_err(codec->dev, "Failed to register DAI: %d\n", ret); | 1155 | dev_err(codec->dev, "Failed to register DAI: %d\n", ret); |
1156 | snd_soc_unregister_codec(codec); | 1156 | goto err_codec; |
1157 | return ret; | ||
1158 | } | 1157 | } |
1159 | 1158 | ||
1160 | return 0; | 1159 | return 0; |
1161 | 1160 | ||
1161 | err_codec: | ||
1162 | snd_soc_unregister_codec(codec); | ||
1162 | err: | 1163 | err: |
1163 | kfree(wm8961); | 1164 | kfree(wm8961); |
1164 | return ret; | 1165 | return ret; |