aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/wm9090.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm9090.c b/sound/soc/codecs/wm9090.c
index 31869afa7007..d1d2c703eab2 100644
--- a/sound/soc/codecs/wm9090.c
+++ b/sound/soc/codecs/wm9090.c
@@ -647,7 +647,7 @@ static int wm9090_i2c_probe(struct i2c_client *i2c,
647 struct wm9090_priv *wm9090; 647 struct wm9090_priv *wm9090;
648 int ret; 648 int ret;
649 649
650 wm9090 = kzalloc(sizeof(*wm9090), GFP_KERNEL); 650 wm9090 = devm_kzalloc(&i2c->dev, sizeof(*wm9090), GFP_KERNEL);
651 if (wm9090 == NULL) { 651 if (wm9090 == NULL) {
652 dev_err(&i2c->dev, "Can not allocate memory\n"); 652 dev_err(&i2c->dev, "Can not allocate memory\n");
653 return -ENOMEM; 653 return -ENOMEM;
@@ -661,8 +661,6 @@ static int wm9090_i2c_probe(struct i2c_client *i2c,
661 661
662 ret = snd_soc_register_codec(&i2c->dev, 662 ret = snd_soc_register_codec(&i2c->dev,
663 &soc_codec_dev_wm9090, NULL, 0); 663 &soc_codec_dev_wm9090, NULL, 0);
664 if (ret < 0)
665 kfree(wm9090);
666 return ret; 664 return ret;
667} 665}
668 666
@@ -671,7 +669,6 @@ static int __devexit wm9090_i2c_remove(struct i2c_client *i2c)
671 struct wm9090_priv *wm9090 = i2c_get_clientdata(i2c); 669 struct wm9090_priv *wm9090 = i2c_get_clientdata(i2c);
672 670
673 snd_soc_unregister_codec(&i2c->dev); 671 snd_soc_unregister_codec(&i2c->dev);
674 kfree(wm9090);
675 672
676 return 0; 673 return 0;
677} 674}