summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/mpc8610_hpcd.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-09-16 01:09:02 -0400
committerDavid S. Miller <davem@davemloft.net>2011-09-16 01:09:02 -0400
commit52b9aca7ae8726d1fb41b97dd1d243d107fef11b (patch)
tree7acee111840bd25183513e9bde08e939ffd57be8 /sound/soc/fsl/mpc8610_hpcd.c
parent7756332f5b64c9c1535712b9679792e8bd4f0019 (diff)
parente2faeec2de9e2c73958e6ea6065dde1e8cd6f3a2 (diff)
Merge branch 'master' of ../netdev/
Diffstat (limited to 'sound/soc/fsl/mpc8610_hpcd.c')
-rw-r--r--sound/soc/fsl/mpc8610_hpcd.c18
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)
}
machine_data = kzalloc(sizeof(struct mpc8610_hpcd_data), GFP_KERNEL);
- if (!machine_data)
- return -ENOMEM;
+ if (!machine_data) {
+ ret = -ENOMEM;
+ goto error_alloc;
+ }
machine_data->dai[0].cpu_dai_name = dev_name(&ssi_pdev->dev);
machine_data->dai[0].ops = &mpc8610_hpcd_ops;
@@ -494,7 +496,7 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev)
ret = platform_device_add(sound_device);
if (ret) {
dev_err(&pdev->dev, "platform device add failed\n");
- goto error;
+ goto error_sound;
}
dev_set_drvdata(&pdev->dev, sound_device);
@@ -502,14 +504,12 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev)
return 0;
+error_sound:
+ platform_device_unregister(sound_device);
error:
- of_node_put(codec_np);
-
- if (sound_device)
- platform_device_unregister(sound_device);
-
kfree(machine_data);
-
+error_alloc:
+ of_node_put(codec_np);
return ret;
}