diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-12-26 07:53:09 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-28 12:22:40 -0500 |
commit | 38b81c1d2517d7c4a6685d49136474bcd0105ab9 (patch) | |
tree | c0c93297ff307a32cf5d772b2a002c2a94645447 /sound | |
parent | 6e4f17cb2b7e8a5327ccc5a6a32442acd408c190 (diff) |
ASoC: Convert adau1701 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')
-rw-r--r-- | sound/soc/codecs/adau1701.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/sound/soc/codecs/adau1701.c b/sound/soc/codecs/adau1701.c index 6a6af567f02a..6b325ea03869 100644 --- a/sound/soc/codecs/adau1701.c +++ b/sound/soc/codecs/adau1701.c | |||
@@ -496,23 +496,19 @@ static __devinit int adau1701_i2c_probe(struct i2c_client *client, | |||
496 | struct adau1701 *adau1701; | 496 | struct adau1701 *adau1701; |
497 | int ret; | 497 | int ret; |
498 | 498 | ||
499 | adau1701 = kzalloc(sizeof(*adau1701), GFP_KERNEL); | 499 | adau1701 = devm_kzalloc(&client->dev, sizeof(*adau1701), GFP_KERNEL); |
500 | if (!adau1701) | 500 | if (!adau1701) |
501 | return -ENOMEM; | 501 | return -ENOMEM; |
502 | 502 | ||
503 | i2c_set_clientdata(client, adau1701); | 503 | i2c_set_clientdata(client, adau1701); |
504 | ret = snd_soc_register_codec(&client->dev, &adau1701_codec_drv, | 504 | ret = snd_soc_register_codec(&client->dev, &adau1701_codec_drv, |
505 | &adau1701_dai, 1); | 505 | &adau1701_dai, 1); |
506 | if (ret < 0) | ||
507 | kfree(adau1701); | ||
508 | |||
509 | return ret; | 506 | return ret; |
510 | } | 507 | } |
511 | 508 | ||
512 | static __devexit int adau1701_i2c_remove(struct i2c_client *client) | 509 | static __devexit int adau1701_i2c_remove(struct i2c_client *client) |
513 | { | 510 | { |
514 | snd_soc_unregister_codec(&client->dev); | 511 | snd_soc_unregister_codec(&client->dev); |
515 | kfree(i2c_get_clientdata(client)); | ||
516 | return 0; | 512 | return 0; |
517 | } | 513 | } |
518 | 514 | ||