diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-12-20 01:39:20 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-20 05:13:58 -0500 |
commit | 4273fcfd71285b4ab6a5d3ce3943e30c2975b797 (patch) | |
tree | 37380f1d9a977c516ba47021da58610d818f1b35 /sound/soc/codecs/ak4641.c | |
parent | 7246492dcf0e56d23f71194f8cd8722a681dfa47 (diff) |
ASoC: Convert ak4641 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/ak4641.c')
-rw-r--r-- | sound/soc/codecs/ak4641.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sound/soc/codecs/ak4641.c b/sound/soc/codecs/ak4641.c index 90184701480d..266ebea2b65a 100644 --- a/sound/soc/codecs/ak4641.c +++ b/sound/soc/codecs/ak4641.c | |||
@@ -602,7 +602,8 @@ static int __devinit ak4641_i2c_probe(struct i2c_client *i2c, | |||
602 | struct ak4641_priv *ak4641; | 602 | struct ak4641_priv *ak4641; |
603 | int ret; | 603 | int ret; |
604 | 604 | ||
605 | ak4641 = kzalloc(sizeof(struct ak4641_priv), GFP_KERNEL); | 605 | ak4641 = devm_kzalloc(&i2c->dev, sizeof(struct ak4641_priv), |
606 | GFP_KERNEL); | ||
606 | if (!ak4641) | 607 | if (!ak4641) |
607 | return -ENOMEM; | 608 | return -ENOMEM; |
608 | 609 | ||
@@ -610,16 +611,12 @@ static int __devinit ak4641_i2c_probe(struct i2c_client *i2c, | |||
610 | 611 | ||
611 | ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_ak4641, | 612 | ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_ak4641, |
612 | ak4641_dai, ARRAY_SIZE(ak4641_dai)); | 613 | ak4641_dai, ARRAY_SIZE(ak4641_dai)); |
613 | if (ret < 0) | ||
614 | kfree(ak4641); | ||
615 | |||
616 | return ret; | 614 | return ret; |
617 | } | 615 | } |
618 | 616 | ||
619 | static int __devexit ak4641_i2c_remove(struct i2c_client *i2c) | 617 | static int __devexit ak4641_i2c_remove(struct i2c_client *i2c) |
620 | { | 618 | { |
621 | snd_soc_unregister_codec(&i2c->dev); | 619 | snd_soc_unregister_codec(&i2c->dev); |
622 | kfree(i2c_get_clientdata(i2c)); | ||
623 | return 0; | 620 | return 0; |
624 | } | 621 | } |
625 | 622 | ||