aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/adau1701.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/adau1701.c')
-rw-r--r--sound/soc/codecs/adau1701.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sound/soc/codecs/adau1701.c b/sound/soc/codecs/adau1701.c
index 8b7e1c50d6e9..6b325ea03869 100644
--- a/sound/soc/codecs/adau1701.c
+++ b/sound/soc/codecs/adau1701.c
@@ -12,13 +12,13 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/i2c.h> 13#include <linux/i2c.h>
14#include <linux/delay.h> 14#include <linux/delay.h>
15#include <linux/sigma.h>
16#include <linux/slab.h> 15#include <linux/slab.h>
17#include <sound/core.h> 16#include <sound/core.h>
18#include <sound/pcm.h> 17#include <sound/pcm.h>
19#include <sound/pcm_params.h> 18#include <sound/pcm_params.h>
20#include <sound/soc.h> 19#include <sound/soc.h>
21 20
21#include "sigmadsp.h"
22#include "adau1701.h" 22#include "adau1701.h"
23 23
24#define ADAU1701_DSPCTRL 0x1c 24#define ADAU1701_DSPCTRL 0x1c
@@ -496,23 +496,19 @@ static __devinit int adau1701_i2c_probe(struct i2c_client *client,
496 struct adau1701 *adau1701; 496 struct adau1701 *adau1701;
497 int ret; 497 int ret;
498 498
499 adau1701 = kzalloc(sizeof(*adau1701), GFP_KERNEL); 499 adau1701 = devm_kzalloc(&client->dev, sizeof(*adau1701), GFP_KERNEL);
500 if (!adau1701) 500 if (!adau1701)
501 return -ENOMEM; 501 return -ENOMEM;
502 502
503 i2c_set_clientdata(client, adau1701); 503 i2c_set_clientdata(client, adau1701);
504 ret = snd_soc_register_codec(&client->dev, &adau1701_codec_drv, 504 ret = snd_soc_register_codec(&client->dev, &adau1701_codec_drv,
505 &adau1701_dai, 1); 505 &adau1701_dai, 1);
506 if (ret < 0)
507 kfree(adau1701);
508
509 return ret; 506 return ret;
510} 507}
511 508
512static __devexit int adau1701_i2c_remove(struct i2c_client *client) 509static __devexit int adau1701_i2c_remove(struct i2c_client *client)
513{ 510{
514 snd_soc_unregister_codec(&client->dev); 511 snd_soc_unregister_codec(&client->dev);
515 kfree(i2c_get_clientdata(client));
516 return 0; 512 return 0;
517} 513}
518 514