mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
ASoC: Convert adau1701 to devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
6e4f17cb2b
commit
38b81c1d25
1 changed files with 1 additions and 5 deletions
|
@ -496,23 +496,19 @@ static __devinit int adau1701_i2c_probe(struct i2c_client *client,
|
||||||
struct adau1701 *adau1701;
|
struct adau1701 *adau1701;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
adau1701 = kzalloc(sizeof(*adau1701), GFP_KERNEL);
|
adau1701 = devm_kzalloc(&client->dev, sizeof(*adau1701), GFP_KERNEL);
|
||||||
if (!adau1701)
|
if (!adau1701)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
i2c_set_clientdata(client, adau1701);
|
i2c_set_clientdata(client, adau1701);
|
||||||
ret = snd_soc_register_codec(&client->dev, &adau1701_codec_drv,
|
ret = snd_soc_register_codec(&client->dev, &adau1701_codec_drv,
|
||||||
&adau1701_dai, 1);
|
&adau1701_dai, 1);
|
||||||
if (ret < 0)
|
|
||||||
kfree(adau1701);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __devexit int adau1701_i2c_remove(struct i2c_client *client)
|
static __devexit int adau1701_i2c_remove(struct i2c_client *client)
|
||||||
{
|
{
|
||||||
snd_soc_unregister_codec(&client->dev);
|
snd_soc_unregister_codec(&client->dev);
|
||||||
kfree(i2c_get_clientdata(client));
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue