summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Lai <b04597@freescale.com>2010-07-20 19:53:25 +0800
committerWilliam Lai <b04597@freescale.com>2010-07-20 20:03:16 +0800
commit5e14cdc0322f6f7e1beb2c2b6b7d737efdf87375 (patch)
tree40c9fc4c9ee2c6a59566bec3a46e4d6f46af1a26
parentd79f97b3f8e39b16c9590cd060b30b32bb7db4c8 (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);