diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-08 03:24:16 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-09 07:36:59 -0500 |
commit | 3025ae45d6d905c8e973bba59d6f9a1be0da734d (patch) | |
tree | e9de6719c277f365ac57ae36b3fb969090caee1c /sound/soc | |
parent | 7fcadfd17699b6b7973ce4f99eae47a11b4c44a7 (diff) |
ASoC: Convert wm8770 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/codecs/wm8770.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8770.c b/sound/soc/codecs/wm8770.c index ea6f007a8114..19374a9e5ba6 100644 --- a/sound/soc/codecs/wm8770.c +++ b/sound/soc/codecs/wm8770.c | |||
@@ -695,7 +695,8 @@ static int __devinit wm8770_spi_probe(struct spi_device *spi) | |||
695 | struct wm8770_priv *wm8770; | 695 | struct wm8770_priv *wm8770; |
696 | int ret; | 696 | int ret; |
697 | 697 | ||
698 | wm8770 = kzalloc(sizeof(struct wm8770_priv), GFP_KERNEL); | 698 | wm8770 = devm_kzalloc(&spi->dev, sizeof(struct wm8770_priv), |
699 | GFP_KERNEL); | ||
699 | if (!wm8770) | 700 | if (!wm8770) |
700 | return -ENOMEM; | 701 | return -ENOMEM; |
701 | 702 | ||
@@ -704,15 +705,13 @@ static int __devinit wm8770_spi_probe(struct spi_device *spi) | |||
704 | 705 | ||
705 | ret = snd_soc_register_codec(&spi->dev, | 706 | ret = snd_soc_register_codec(&spi->dev, |
706 | &soc_codec_dev_wm8770, &wm8770_dai, 1); | 707 | &soc_codec_dev_wm8770, &wm8770_dai, 1); |
707 | if (ret < 0) | 708 | |
708 | kfree(wm8770); | ||
709 | return ret; | 709 | return ret; |
710 | } | 710 | } |
711 | 711 | ||
712 | static int __devexit wm8770_spi_remove(struct spi_device *spi) | 712 | static int __devexit wm8770_spi_remove(struct spi_device *spi) |
713 | { | 713 | { |
714 | snd_soc_unregister_codec(&spi->dev); | 714 | snd_soc_unregister_codec(&spi->dev); |
715 | kfree(spi_get_drvdata(spi)); | ||
716 | return 0; | 715 | return 0; |
717 | } | 716 | } |
718 | 717 | ||