aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/da7210.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/da7210.c')
-rw-r--r--sound/soc/codecs/da7210.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/soc/codecs/da7210.c b/sound/soc/codecs/da7210.c
index 3e42d1e0e601..3c51d6a57523 100644
--- a/sound/soc/codecs/da7210.c
+++ b/sound/soc/codecs/da7210.c
@@ -499,7 +499,7 @@ static int da7210_init(struct da7210_priv *da7210)
499 ret = snd_soc_register_dai(&da7210_dai); 499 ret = snd_soc_register_dai(&da7210_dai);
500 if (ret) { 500 if (ret) {
501 dev_err(codec->dev, "Failed to register DAI: %d\n", ret); 501 dev_err(codec->dev, "Failed to register DAI: %d\n", ret);
502 goto init_err; 502 goto codec_err;
503 } 503 }
504 504
505 /* FIXME 505 /* FIXME
@@ -585,6 +585,8 @@ static int da7210_init(struct da7210_priv *da7210)
585 585
586 return ret; 586 return ret;
587 587
588codec_err:
589 snd_soc_unregister_codec(codec);
588init_err: 590init_err:
589 kfree(codec->reg_cache); 591 kfree(codec->reg_cache);
590 codec->reg_cache = NULL; 592 codec->reg_cache = NULL;
@@ -612,8 +614,10 @@ static int __devinit da7210_i2c_probe(struct i2c_client *i2c,
612 codec->control_data = i2c; 614 codec->control_data = i2c;
613 615
614 ret = da7210_init(da7210); 616 ret = da7210_init(da7210);
615 if (ret < 0) 617 if (ret < 0) {
616 pr_err("Failed to initialise da7210 audio codec\n"); 618 pr_err("Failed to initialise da7210 audio codec\n");
619 kfree(da7210);
620 }
617 621
618 return ret; 622 return ret;
619} 623}