aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/pcm3008.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-07-10 11:49:16 -0400
committerMark Brown <broonie@linaro.org>2013-07-15 06:11:03 -0400
commit33319a2fcc4482a97a8924e777bc0036d1d96696 (patch)
tree186ce739e1cad53ac087f500ee4dba057b5a567d /sound/soc/codecs/pcm3008.c
parentd7f184958e5292280c1048df951932bbfcd95f60 (diff)
ASoC: pcm3008: Check for platform data
The driver will crash if none is provided. Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/codecs/pcm3008.c')
-rw-r--r--sound/soc/codecs/pcm3008.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/codecs/pcm3008.c b/sound/soc/codecs/pcm3008.c
index 8ab1c03d26bd..4fa4ded30407 100644
--- a/sound/soc/codecs/pcm3008.c
+++ b/sound/soc/codecs/pcm3008.c
@@ -92,6 +92,9 @@ static int pcm3008_codec_probe(struct platform_device *pdev)
92 struct pcm3008_setup_data *setup = pdev->dev.platform_data; 92 struct pcm3008_setup_data *setup = pdev->dev.platform_data;
93 int ret; 93 int ret;
94 94
95 if (!setup)
96 return -EINVAL;
97
95 /* DEM1 DEM0 DE-EMPHASIS_MODE 98 /* DEM1 DEM0 DE-EMPHASIS_MODE
96 * Low Low De-emphasis 44.1 kHz ON 99 * Low Low De-emphasis 44.1 kHz ON
97 * Low High De-emphasis OFF 100 * Low High De-emphasis OFF