aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8991.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/wm8991.c')
-rw-r--r--sound/soc/codecs/wm8991.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/sound/soc/codecs/wm8991.c b/sound/soc/codecs/wm8991.c
index 9ac31ba9b82e..fe439f027e10 100644
--- a/sound/soc/codecs/wm8991.c
+++ b/sound/soc/codecs/wm8991.c
@@ -1363,7 +1363,7 @@ static __devinit int wm8991_i2c_probe(struct i2c_client *i2c,
1363 struct wm8991_priv *wm8991; 1363 struct wm8991_priv *wm8991;
1364 int ret; 1364 int ret;
1365 1365
1366 wm8991 = kzalloc(sizeof *wm8991, GFP_KERNEL); 1366 wm8991 = devm_kzalloc(&i2c->dev, sizeof(*wm8991), GFP_KERNEL);
1367 if (!wm8991) 1367 if (!wm8991)
1368 return -ENOMEM; 1368 return -ENOMEM;
1369 1369
@@ -1372,15 +1372,14 @@ static __devinit int wm8991_i2c_probe(struct i2c_client *i2c,
1372 1372
1373 ret = snd_soc_register_codec(&i2c->dev, 1373 ret = snd_soc_register_codec(&i2c->dev,
1374 &soc_codec_dev_wm8991, &wm8991_dai, 1); 1374 &soc_codec_dev_wm8991, &wm8991_dai, 1);
1375 if (ret < 0) 1375
1376 kfree(wm8991);
1377 return ret; 1376 return ret;
1378} 1377}
1379 1378
1380static __devexit int wm8991_i2c_remove(struct i2c_client *client) 1379static __devexit int wm8991_i2c_remove(struct i2c_client *client)
1381{ 1380{
1382 snd_soc_unregister_codec(&client->dev); 1381 snd_soc_unregister_codec(&client->dev);
1383 kfree(i2c_get_clientdata(client)); 1382
1384 return 0; 1383 return 0;
1385} 1384}
1386 1385
@@ -1400,23 +1399,7 @@ static struct i2c_driver wm8991_i2c_driver = {
1400 .id_table = wm8991_i2c_id, 1399 .id_table = wm8991_i2c_id,
1401}; 1400};
1402 1401
1403static int __init wm8991_modinit(void) 1402module_i2c_driver(wm8991_i2c_driver);
1404{
1405 int ret;
1406 ret = i2c_add_driver(&wm8991_i2c_driver);
1407 if (ret != 0) {
1408 printk(KERN_ERR "Failed to register WM8991 I2C driver: %d\n",
1409 ret);
1410 }
1411 return 0;
1412}
1413module_init(wm8991_modinit);
1414
1415static void __exit wm8991_exit(void)
1416{
1417 i2c_del_driver(&wm8991_i2c_driver);
1418}
1419module_exit(wm8991_exit);
1420 1403
1421MODULE_DESCRIPTION("ASoC WM8991 driver"); 1404MODULE_DESCRIPTION("ASoC WM8991 driver");
1422MODULE_AUTHOR("Graeme Gregory"); 1405MODULE_AUTHOR("Graeme Gregory");