aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-03 06:29:38 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-03 16:35:05 -0500
commit0d1fe0d4521436d8af2111045a682c4c8aa1b55d (patch)
treec1d393fd90c981268298c8b938714251c62e19be /sound
parentb03e96e4d619183cbe9aea55f2340596c1fecf64 (diff)
ASoC: Convert WM8350 to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/wm8350.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c
index f39497fc13e0..7b095aeef695 100644
--- a/sound/soc/codecs/wm8350.c
+++ b/sound/soc/codecs/wm8350.c
@@ -1553,7 +1553,8 @@ static int wm8350_codec_probe(struct snd_soc_codec *codec)
1553 return -EINVAL; 1553 return -EINVAL;
1554 } 1554 }
1555 1555
1556 priv = kzalloc(sizeof(struct wm8350_data), GFP_KERNEL); 1556 priv = devm_kzalloc(codec->dev, sizeof(struct wm8350_data),
1557 GFP_KERNEL);
1557 if (priv == NULL) 1558 if (priv == NULL)
1558 return -ENOMEM; 1559 return -ENOMEM;
1559 snd_soc_codec_set_drvdata(codec, priv); 1560 snd_soc_codec_set_drvdata(codec, priv);
@@ -1564,7 +1565,7 @@ static int wm8350_codec_probe(struct snd_soc_codec *codec)
1564 ret = regulator_bulk_get(wm8350->dev, ARRAY_SIZE(priv->supplies), 1565 ret = regulator_bulk_get(wm8350->dev, ARRAY_SIZE(priv->supplies),
1565 priv->supplies); 1566 priv->supplies);
1566 if (ret != 0) 1567 if (ret != 0)
1567 goto err_priv; 1568 return ret;
1568 1569
1569 wm8350->codec.codec = codec; 1570 wm8350->codec.codec = codec;
1570 codec->control_data = wm8350; 1571 codec->control_data = wm8350;
@@ -1640,10 +1641,6 @@ static int wm8350_codec_probe(struct snd_soc_codec *codec)
1640 wm8350_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 1641 wm8350_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
1641 1642
1642 return 0; 1643 return 0;
1643
1644err_priv:
1645 kfree(priv);
1646 return ret;
1647} 1644}
1648 1645
1649static int wm8350_codec_remove(struct snd_soc_codec *codec) 1646static int wm8350_codec_remove(struct snd_soc_codec *codec)
@@ -1676,7 +1673,7 @@ static int wm8350_codec_remove(struct snd_soc_codec *codec)
1676 wm8350_clear_bits(wm8350, WM8350_POWER_MGMT_5, WM8350_CODEC_ENA); 1673 wm8350_clear_bits(wm8350, WM8350_POWER_MGMT_5, WM8350_CODEC_ENA);
1677 1674
1678 regulator_bulk_free(ARRAY_SIZE(priv->supplies), priv->supplies); 1675 regulator_bulk_free(ARRAY_SIZE(priv->supplies), priv->supplies);
1679 kfree(priv); 1676
1680 return 0; 1677 return 0;
1681} 1678}
1682 1679