diff options
Diffstat (limited to 'sound/soc/codecs/wm9081.c')
-rw-r--r-- | sound/soc/codecs/wm9081.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sound/soc/codecs/wm9081.c b/sound/soc/codecs/wm9081.c index 13186fb4dcb4..76b37ff6c264 100644 --- a/sound/soc/codecs/wm9081.c +++ b/sound/soc/codecs/wm9081.c | |||
@@ -1356,7 +1356,7 @@ static int wm9081_register(struct wm9081_priv *wm9081, | |||
1356 | ret = snd_soc_codec_set_cache_io(codec, 8, 16, control); | 1356 | ret = snd_soc_codec_set_cache_io(codec, 8, 16, control); |
1357 | if (ret != 0) { | 1357 | if (ret != 0) { |
1358 | dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); | 1358 | dev_err(codec->dev, "Failed to set cache I/O: %d\n", ret); |
1359 | return ret; | 1359 | goto err; |
1360 | } | 1360 | } |
1361 | 1361 | ||
1362 | reg = snd_soc_read(codec, WM9081_SOFTWARE_RESET); | 1362 | reg = snd_soc_read(codec, WM9081_SOFTWARE_RESET); |
@@ -1369,7 +1369,7 @@ static int wm9081_register(struct wm9081_priv *wm9081, | |||
1369 | ret = wm9081_reset(codec); | 1369 | ret = wm9081_reset(codec); |
1370 | if (ret < 0) { | 1370 | if (ret < 0) { |
1371 | dev_err(codec->dev, "Failed to issue reset\n"); | 1371 | dev_err(codec->dev, "Failed to issue reset\n"); |
1372 | return ret; | 1372 | goto err; |
1373 | } | 1373 | } |
1374 | 1374 | ||
1375 | wm9081_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 1375 | wm9081_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
@@ -1388,18 +1388,19 @@ static int wm9081_register(struct wm9081_priv *wm9081, | |||
1388 | ret = snd_soc_register_codec(codec); | 1388 | ret = snd_soc_register_codec(codec); |
1389 | if (ret != 0) { | 1389 | if (ret != 0) { |
1390 | dev_err(codec->dev, "Failed to register codec: %d\n", ret); | 1390 | dev_err(codec->dev, "Failed to register codec: %d\n", ret); |
1391 | return ret; | 1391 | goto err; |
1392 | } | 1392 | } |
1393 | 1393 | ||
1394 | ret = snd_soc_register_dai(&wm9081_dai); | 1394 | ret = snd_soc_register_dai(&wm9081_dai); |
1395 | if (ret != 0) { | 1395 | if (ret != 0) { |
1396 | dev_err(codec->dev, "Failed to register DAI: %d\n", ret); | 1396 | dev_err(codec->dev, "Failed to register DAI: %d\n", ret); |
1397 | snd_soc_unregister_codec(codec); | 1397 | goto err_codec; |
1398 | return ret; | ||
1399 | } | 1398 | } |
1400 | 1399 | ||
1401 | return 0; | 1400 | return 0; |
1402 | 1401 | ||
1402 | err_codec: | ||
1403 | snd_soc_unregister_codec(codec); | ||
1403 | err: | 1404 | err: |
1404 | kfree(wm9081); | 1405 | kfree(wm9081); |
1405 | return ret; | 1406 | return ret; |