]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: cs35l35: Stash dev pointer directly rather than CODEC pointer
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Fri, 17 Mar 2017 15:44:55 +0000 (15:44 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 17 Mar 2017 21:40:31 +0000 (21:40 +0000)
commit3d62caf8b2834cc48c04a2cf5774814c96359560
treeab16d17469e43309973a6499fb6659ff36ed8e3d
parent64787bd9326cdcda251c381189bba94964ac63b4
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>
sound/soc/codecs/cs35l35.c
sound/soc/codecs/cs35l35.h