summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/cs42l73.c
diff options
context:
space:
mode:
authorBrian Austin <brian.austin@cirrus.com>2011-11-28 22:49:31 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-11-28 23:12:25 +0100
commitcc0b401ad87e830843d3034f892c4017f9837fae (patch)
treec6596de9ed70bfee01b97486ca6591095017abe7 /sound/soc/codecs/cs42l73.c
parentASoC: Convert tegra_spdif to use module_platform_driver() (diff)
downloadlinux-cc0b401ad87e830843d3034f892c4017f9837fae.tar.xz
linux-cc0b401ad87e830843d3034f892c4017f9837fae.zip
ASoC: Convert CS42L73 to devm_kzalloc()
Signed-off-by: Brian Austin <brian.austin@cirrus.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/cs42l73.c')
-rw-r--r--sound/soc/codecs/cs42l73.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sound/soc/codecs/cs42l73.c b/sound/soc/codecs/cs42l73.c
index d09578f397da..9fd5de77cafb 100644
--- a/sound/soc/codecs/cs42l73.c
+++ b/sound/soc/codecs/cs42l73.c
@@ -1339,7 +1339,8 @@ static __devinit int cs42l73_i2c_probe(struct i2c_client *i2c_client,
unsigned int devid = 0;
unsigned int reg;
- cs42l73 = kzalloc((sizeof *cs42l73), GFP_KERNEL);
+ cs42l73 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs42l73_private),
+ GFP_KERNEL);
if (!cs42l73) {
dev_err(&i2c_client->dev, "could not allocate codec\n");
return -ENOMEM;
@@ -1394,8 +1395,6 @@ err_regmap:
regmap_exit(cs42l73->regmap);
err:
- kfree(cs42l73);
-
return ret;
}
@@ -1406,7 +1405,6 @@ static __devexit int cs42l73_i2c_remove(struct i2c_client *client)
snd_soc_unregister_codec(&client->dev);
regmap_exit(cs42l73->regmap);
- kfree(cs42l73);
return 0;
}