summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs
diff options
context:
space:
mode:
authoroder_chiou@realtek.com2017-11-20 11:23:19 +0100
committerMark Brown2017-11-27 17:44:57 +0100
commit346cccf88319344c9f513bd85df6ae2258e8a8ea (patch)
tree83c135f1f20567402fff59a2dc7abd302abb4a4d /sound/soc/codecs
parentASoC: rt5514: Make sure the DMIC delay will be happened after normal SUPPLY w... (diff)
downloadkernel-qcow2-linux-346cccf88319344c9f513bd85df6ae2258e8a8ea.tar.gz
kernel-qcow2-linux-346cccf88319344c9f513bd85df6ae2258e8a8ea.tar.xz
kernel-qcow2-linux-346cccf88319344c9f513bd85df6ae2258e8a8ea.zip
ASoC: rt5514: Add the sanity check for the driver_data in the resume function
If the rt5514 spi driver is loaded, but the snd_soc_platform_driver is not loaded by the correct DAI settings, the NULL pointer will be gotten by snd_soc_platform_get_drvdata in the resume function. Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r--sound/soc/codecs/rt5514-spi.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/soc/codecs/rt5514-spi.c b/sound/soc/codecs/rt5514-spi.c
index 2df91db765ac..ca6a90d8fc39 100644
--- a/sound/soc/codecs/rt5514-spi.c
+++ b/sound/soc/codecs/rt5514-spi.c
@@ -482,10 +482,13 @@ static int __maybe_unused rt5514_resume(struct device *dev)
if (device_may_wakeup(dev))
disable_irq_wake(irq);
- if (rt5514_dsp->substream) {
- rt5514_spi_burst_read(RT5514_IRQ_CTRL, (u8 *)&buf, sizeof(buf));
- if (buf[0] & RT5514_IRQ_STATUS_BIT)
- rt5514_schedule_copy(rt5514_dsp);
+ if (rt5514_dsp) {
+ if (rt5514_dsp->substream) {
+ rt5514_spi_burst_read(RT5514_IRQ_CTRL, (u8 *)&buf,
+ sizeof(buf));
+ if (buf[0] & RT5514_IRQ_STATUS_BIT)
+ rt5514_schedule_copy(rt5514_dsp);
+ }
}
return 0;