ASoC: Convert wm9081 driver to use devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
diff --git a/sound/soc/codecs/wm9081.c b/sound/soc/codecs/wm9081.c
index ba12690..8a4b970 100644
--- a/sound/soc/codecs/wm9081.c
+++ b/sound/soc/codecs/wm9081.c
@@ -1361,7 +1361,8 @@
unsigned int reg;
int ret;
- wm9081 = kzalloc(sizeof(struct wm9081_priv), GFP_KERNEL);
+ wm9081 = devm_kzalloc(&i2c->dev, sizeof(struct wm9081_priv),
+ GFP_KERNEL);
if (wm9081 == NULL)
return -ENOMEM;
@@ -1405,7 +1406,6 @@
err_regmap:
regmap_exit(wm9081->regmap);
err:
- kfree(wm9081);
return ret;
}
@@ -1416,7 +1416,6 @@
snd_soc_unregister_codec(&client->dev);
regmap_exit(wm9081->regmap);
- kfree(i2c_get_clientdata(client));
return 0;
}