summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/cs35l35.h
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2017-03-17 15:44:55 +0000
committerMark Brown <broonie@kernel.org>2017-03-17 21:40:31 +0000
commit5d3d0ad688eacf9567d7d67a5eec3c436cc1064c (patch)
treeab16d17469e43309973a6499fb6659ff36ed8e3d /sound/soc/codecs/cs35l35.h
parentbfe41c678d49f440de3ae80b945f7f94d5dbd340 (diff)
downloadlinux-5d3d0ad688eacf9567d7d67a5eec3c436cc1064c.tar.bz2
ASoC: cs35l35: Stash dev pointer directly rather than CODEC pointer
The driver stashes a CODEC pointer in the cs35l35_private structure, which is used to obtain a struct device pointer for error messages in the interrupt handler. However, doing so is not very safe as the interrupt is registered, as it should be in bus probe, but the CODEC pointer can't be safely stored until the ASoC level probe. This leaves a window between the two probes where if any interrupts are received a NULL pointer will be deferenced in the IRQ handler. Fix this issue by saving a pointer to the device directly and passing that to the error messages in the interrupt handler rather than using the CODEC pointer to access the device pointer. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/cs35l35.h')
-rw-r--r--sound/soc/codecs/cs35l35.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/codecs/cs35l35.h b/sound/soc/codecs/cs35l35.h
index c203081fc94c..156d2f0e6fd8 100644
--- a/sound/soc/codecs/cs35l35.h
+++ b/sound/soc/codecs/cs35l35.h
@@ -265,7 +265,7 @@
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
struct cs35l35_private {
- struct snd_soc_codec *codec;
+ struct device *dev;
struct cs35l35_platform_data pdata;
struct regmap *regmap;
struct regulator_bulk_data supplies[2];