summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorWilliam Lai <b04597@freescale.com>2009-11-16 11:34:42 +0800
committerAlejandro Gonzalez <alex.gonzalez@digi.com>2010-02-12 17:19:34 +0100
commitcdc31b5f2df2d7194cd26b490f10af91aa3417b2 (patch)
treeca07799318a10d7d216c5e49429da41e3add5d65 /sound
parentd6ba1ab5ad620abcf946cb20bce6626ab3ae75c8 (diff)
ENGR00118226 MX35 PM: System crashes when try to wake up from standby
The ak4647_codec is not initialized as there is no ak4647 codec existing on MX35 board. In the 31 kernel, the card and codec drivers are registered separately, and there is no check whether the codec is probed successfully or not. On MX35 board, the card is sucessfully registered, but there is no ak4647 codec. In this case, the system will crash if the system try to invoke the codec's resume function. To resolve the problem, add a check in registering the card. If the codec does not exist, give up registering the card either. Signed-off-by: William Lai <b04597@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/imx/imx-3stack-ak4647.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/soc/imx/imx-3stack-ak4647.c b/sound/soc/imx/imx-3stack-ak4647.c
index bb3606c57fd4..fd595c137522 100644
--- a/sound/soc/imx/imx-3stack-ak4647.c
+++ b/sound/soc/imx/imx-3stack-ak4647.c
@@ -412,6 +412,12 @@ static int __init imx_3stack_asoc_init(void)
ret = platform_driver_register(&imx_3stack_ak4647_driver);
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", 3);
if (!imx_3stack_snd_device)
goto err_device_alloc;