diff options
Diffstat (limited to 'sound/soc/codecs/cs42l73.c')
-rw-r--r-- | sound/soc/codecs/cs42l73.c | 6 |
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, | |||
1339 | unsigned int devid = 0; | 1339 | unsigned int devid = 0; |
1340 | unsigned int reg; | 1340 | unsigned int reg; |
1341 | 1341 | ||
1342 | cs42l73 = kzalloc((sizeof *cs42l73), GFP_KERNEL); | 1342 | cs42l73 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs42l73_private), |
1343 | GFP_KERNEL); | ||
1343 | if (!cs42l73) { | 1344 | if (!cs42l73) { |
1344 | dev_err(&i2c_client->dev, "could not allocate codec\n"); | 1345 | dev_err(&i2c_client->dev, "could not allocate codec\n"); |
1345 | return -ENOMEM; | 1346 | return -ENOMEM; |
@@ -1394,8 +1395,6 @@ err_regmap: | |||
1394 | regmap_exit(cs42l73->regmap); | 1395 | regmap_exit(cs42l73->regmap); |
1395 | 1396 | ||
1396 | err: | 1397 | err: |
1397 | kfree(cs42l73); | ||
1398 | |||
1399 | return ret; | 1398 | return ret; |
1400 | } | 1399 | } |
1401 | 1400 | ||
@@ -1406,7 +1405,6 @@ static __devexit int cs42l73_i2c_remove(struct i2c_client *client) | |||
1406 | snd_soc_unregister_codec(&client->dev); | 1405 | snd_soc_unregister_codec(&client->dev); |
1407 | regmap_exit(cs42l73->regmap); | 1406 | regmap_exit(cs42l73->regmap); |
1408 | 1407 | ||
1409 | kfree(cs42l73); | ||
1410 | return 0; | 1408 | return 0; |
1411 | } | 1409 | } |
1412 | 1410 | ||