aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/cs35l32.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/cs35l32.c')
-rw-r--r--sound/soc/codecs/cs35l32.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/sound/soc/codecs/cs35l32.c b/sound/soc/codecs/cs35l32.c
index 7e9806206648..bc3a72e4c4ed 100644
--- a/sound/soc/codecs/cs35l32.c
+++ b/sound/soc/codecs/cs35l32.c
@@ -355,13 +355,9 @@ static int cs35l32_i2c_probe(struct i2c_client *i2c_client,
355 unsigned int devid = 0; 355 unsigned int devid = 0;
356 unsigned int reg; 356 unsigned int reg;
357 357
358 358 cs35l32 = devm_kzalloc(&i2c_client->dev, sizeof(*cs35l32), GFP_KERNEL);
359 cs35l32 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs35l32_private), 359 if (!cs35l32)
360 GFP_KERNEL);
361 if (!cs35l32) {
362 dev_err(&i2c_client->dev, "could not allocate codec\n");
363 return -ENOMEM; 360 return -ENOMEM;
364 }
365 361
366 i2c_set_clientdata(i2c_client, cs35l32); 362 i2c_set_clientdata(i2c_client, cs35l32);
367 363
@@ -375,13 +371,11 @@ static int cs35l32_i2c_probe(struct i2c_client *i2c_client,
375 if (pdata) { 371 if (pdata) {
376 cs35l32->pdata = *pdata; 372 cs35l32->pdata = *pdata;
377 } else { 373 } else {
378 pdata = devm_kzalloc(&i2c_client->dev, 374 pdata = devm_kzalloc(&i2c_client->dev, sizeof(*pdata),
379 sizeof(struct cs35l32_platform_data), 375 GFP_KERNEL);
380 GFP_KERNEL); 376 if (!pdata)
381 if (!pdata) {
382 dev_err(&i2c_client->dev, "could not allocate pdata\n");
383 return -ENOMEM; 377 return -ENOMEM;
384 } 378
385 if (i2c_client->dev.of_node) { 379 if (i2c_client->dev.of_node) {
386 ret = cs35l32_handle_of_data(i2c_client, 380 ret = cs35l32_handle_of_data(i2c_client,
387 &cs35l32->pdata); 381 &cs35l32->pdata);