summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Lai <b04597@freescale.com>2010-07-20 19:53:25 +0800
committerJustin Waters <justin.waters@timesys.com>2010-12-17 12:10:53 -0500
commit7bec735fb7e5aaed5194d6e00fae827f6b1cef40 (patch)
tree40c9fc4c9ee2c6a59566bec3a46e4d6f46af1a26
parent19670d565beb96904af3d5c642efb65bb1e0e617 (diff)
ENGR00125345 ALSA CS42888: Judge the codec member after initialization
Judge the codec memeber of the snd_soc_card_imx_3stack after the platform_device_add function, as only after this function, the cs42888_codec pointer will be passed to. Signed-off-by: William Lai <b04597@freescale.com>
-rw-r--r--sound/soc/imx/imx-3stack-cs42888.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/sound/soc/imx/imx-3stack-cs42888.c b/sound/soc/imx/imx-3stack-cs42888.c
index 6a5f1b6e0c58..181dd11a65f7 100644
--- a/sound/soc/imx/imx-3stack-cs42888.c
+++ b/sound/soc/imx/imx-3stack-cs42888.c
@@ -380,17 +380,13 @@ static int __init imx_3stack_asoc_init(void)
if (ret < 0)
goto exit;
- if (snd_soc_card_imx_3stack.codec == NULL) {
- ret = -ENOMEM;
- goto err_device_alloc;
- }
imx_3stack_snd_device = platform_device_alloc("soc-audio", 1);
if (!imx_3stack_snd_device)
goto err_device_alloc;
platform_set_drvdata(imx_3stack_snd_device, &imx_3stack_snd_devdata);
imx_3stack_snd_devdata.dev = &imx_3stack_snd_device->dev;
ret = platform_device_add(imx_3stack_snd_device);
- if (0 == ret)
+ if (0 == ret && snd_soc_card_imx_3stack.codec != NULL)
goto exit;
platform_device_put(imx_3stack_snd_device);