diff options
Diffstat (limited to 'sound/soc/fsl/mpc8610_hpcd.c')
-rw-r--r-- | sound/soc/fsl/mpc8610_hpcd.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sound/soc/fsl/mpc8610_hpcd.c b/sound/soc/fsl/mpc8610_hpcd.c index a19297959587..358f0baaf71b 100644 --- a/sound/soc/fsl/mpc8610_hpcd.c +++ b/sound/soc/fsl/mpc8610_hpcd.c | |||
@@ -345,8 +345,10 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev) | |||
345 | } | 345 | } |
346 | 346 | ||
347 | machine_data = kzalloc(sizeof(struct mpc8610_hpcd_data), GFP_KERNEL); | 347 | machine_data = kzalloc(sizeof(struct mpc8610_hpcd_data), GFP_KERNEL); |
348 | if (!machine_data) | 348 | if (!machine_data) { |
349 | return -ENOMEM; | 349 | ret = -ENOMEM; |
350 | goto error_alloc; | ||
351 | } | ||
350 | 352 | ||
351 | machine_data->dai[0].cpu_dai_name = dev_name(&ssi_pdev->dev); | 353 | machine_data->dai[0].cpu_dai_name = dev_name(&ssi_pdev->dev); |
352 | machine_data->dai[0].ops = &mpc8610_hpcd_ops; | 354 | machine_data->dai[0].ops = &mpc8610_hpcd_ops; |
@@ -494,7 +496,7 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev) | |||
494 | ret = platform_device_add(sound_device); | 496 | ret = platform_device_add(sound_device); |
495 | if (ret) { | 497 | if (ret) { |
496 | dev_err(&pdev->dev, "platform device add failed\n"); | 498 | dev_err(&pdev->dev, "platform device add failed\n"); |
497 | goto error; | 499 | goto error_sound; |
498 | } | 500 | } |
499 | dev_set_drvdata(&pdev->dev, sound_device); | 501 | dev_set_drvdata(&pdev->dev, sound_device); |
500 | 502 | ||
@@ -502,14 +504,12 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev) | |||
502 | 504 | ||
503 | return 0; | 505 | return 0; |
504 | 506 | ||
507 | error_sound: | ||
508 | platform_device_unregister(sound_device); | ||
505 | error: | 509 | error: |
506 | of_node_put(codec_np); | ||
507 | |||
508 | if (sound_device) | ||
509 | platform_device_unregister(sound_device); | ||
510 | |||
511 | kfree(machine_data); | 510 | kfree(machine_data); |
512 | 511 | error_alloc: | |
512 | of_node_put(codec_np); | ||
513 | return ret; | 513 | return ret; |
514 | } | 514 | } |
515 | 515 | ||