diff options
-rw-r--r-- | sound/soc/codecs/wm9081.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sound/soc/codecs/wm9081.c b/sound/soc/codecs/wm9081.c index ba126906f82c..8a4b97060444 100644 --- a/sound/soc/codecs/wm9081.c +++ b/sound/soc/codecs/wm9081.c | |||
@@ -1361,7 +1361,8 @@ static __devinit int wm9081_i2c_probe(struct i2c_client *i2c, | |||
1361 | unsigned int reg; | 1361 | unsigned int reg; |
1362 | int ret; | 1362 | int ret; |
1363 | 1363 | ||
1364 | wm9081 = kzalloc(sizeof(struct wm9081_priv), GFP_KERNEL); | 1364 | wm9081 = devm_kzalloc(&i2c->dev, sizeof(struct wm9081_priv), |
1365 | GFP_KERNEL); | ||
1365 | if (wm9081 == NULL) | 1366 | if (wm9081 == NULL) |
1366 | return -ENOMEM; | 1367 | return -ENOMEM; |
1367 | 1368 | ||
@@ -1405,7 +1406,6 @@ static __devinit int wm9081_i2c_probe(struct i2c_client *i2c, | |||
1405 | err_regmap: | 1406 | err_regmap: |
1406 | regmap_exit(wm9081->regmap); | 1407 | regmap_exit(wm9081->regmap); |
1407 | err: | 1408 | err: |
1408 | kfree(wm9081); | ||
1409 | 1409 | ||
1410 | return ret; | 1410 | return ret; |
1411 | } | 1411 | } |
@@ -1416,7 +1416,6 @@ static __devexit int wm9081_i2c_remove(struct i2c_client *client) | |||
1416 | 1416 | ||
1417 | snd_soc_unregister_codec(&client->dev); | 1417 | snd_soc_unregister_codec(&client->dev); |
1418 | regmap_exit(wm9081->regmap); | 1418 | regmap_exit(wm9081->regmap); |
1419 | kfree(i2c_get_clientdata(client)); | ||
1420 | return 0; | 1419 | return 0; |
1421 | } | 1420 | } |
1422 | 1421 | ||