diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-09-11 21:24:12 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-09-11 21:36:43 -0400 |
commit | 3217b0f5b6fd91440fd72cf24a8986b3f99d0d84 (patch) | |
tree | 5229fffcb25ce39e0e989e101192bb00068c84c5 | |
parent | 7e94ca4752991c3830515f6e17ee5a7334a7f590 (diff) |
ASoC: wm8510: Convert to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | sound/soc/codecs/wm8510.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sound/soc/codecs/wm8510.c b/sound/soc/codecs/wm8510.c index 56a049555e2c..98f28a006faf 100644 --- a/sound/soc/codecs/wm8510.c +++ b/sound/soc/codecs/wm8510.c | |||
@@ -592,7 +592,8 @@ static int __devinit wm8510_spi_probe(struct spi_device *spi) | |||
592 | struct wm8510_priv *wm8510; | 592 | struct wm8510_priv *wm8510; |
593 | int ret; | 593 | int ret; |
594 | 594 | ||
595 | wm8510 = kzalloc(sizeof(struct wm8510_priv), GFP_KERNEL); | 595 | wm8510 = devm_kzalloc(&spi->dev, sizeof(struct wm8510_priv), |
596 | GFP_KERNEL); | ||
596 | if (wm8510 == NULL) | 597 | if (wm8510 == NULL) |
597 | return -ENOMEM; | 598 | return -ENOMEM; |
598 | 599 | ||
@@ -601,8 +602,7 @@ static int __devinit wm8510_spi_probe(struct spi_device *spi) | |||
601 | 602 | ||
602 | ret = snd_soc_register_codec(&spi->dev, | 603 | ret = snd_soc_register_codec(&spi->dev, |
603 | &soc_codec_dev_wm8510, &wm8510_dai, 1); | 604 | &soc_codec_dev_wm8510, &wm8510_dai, 1); |
604 | if (ret < 0) | 605 | |
605 | kfree(wm8510); | ||
606 | return ret; | 606 | return ret; |
607 | } | 607 | } |
608 | 608 | ||
@@ -630,7 +630,8 @@ static __devinit int wm8510_i2c_probe(struct i2c_client *i2c, | |||
630 | struct wm8510_priv *wm8510; | 630 | struct wm8510_priv *wm8510; |
631 | int ret; | 631 | int ret; |
632 | 632 | ||
633 | wm8510 = kzalloc(sizeof(struct wm8510_priv), GFP_KERNEL); | 633 | wm8510 = devm_kzalloc(&i2c->dev, sizeof(struct wm8510_priv), |
634 | GFP_KERNEL); | ||
634 | if (wm8510 == NULL) | 635 | if (wm8510 == NULL) |
635 | return -ENOMEM; | 636 | return -ENOMEM; |
636 | 637 | ||
@@ -639,8 +640,7 @@ static __devinit int wm8510_i2c_probe(struct i2c_client *i2c, | |||
639 | 640 | ||
640 | ret = snd_soc_register_codec(&i2c->dev, | 641 | ret = snd_soc_register_codec(&i2c->dev, |
641 | &soc_codec_dev_wm8510, &wm8510_dai, 1); | 642 | &soc_codec_dev_wm8510, &wm8510_dai, 1); |
642 | if (ret < 0) | 643 | |
643 | kfree(wm8510); | ||
644 | return ret; | 644 | return ret; |
645 | } | 645 | } |
646 | 646 | ||