linux/sound/soc
Jarkko Nikula 4da533932d ASoC: core: Fix component_list corruption when unloading modules
This fixes module unload regressions introduced by commits 98e639fb8a
("ASoC: Track which components have been registered with
snd_soc_register_component()") and b37f1d123c ("ASoC: Let snd_soc_platform
subclass snd_soc_component").

First commit causes component_list to be corrupted when removing codec and
second when removing platform. Reason for both is that components associated
with platform or codec are never removed from the list because for them
registered_as_component field in struct snd_soc_component is always false.

Now list becomes corrupted when snd_soc_unregister_platform() or
snd_soc_unregister_codec() frees the platform or codec structure and where
the associated struct snd_soc_component is embedded.

Fix these by moving component unregistration and cleanup to a new local
function __snd_soc_unregister_component() that takes component as its
argument.

Since component is known for platforms and codecs the
__snd_soc_unregister_component() can be called directly and
snd_soc_unregister_component() takes care to find and unregister only
components that were registered using snd_soc_register_component().

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-29 10:09:11 -07:00
..
adi ASoC: axi-{spdif,i2s}: Remove SND_DMAENGINE_PCM_FLAG_NO_RESIDUE flag 2014-01-14 21:28:39 +00:00
atmel Merge remote-tracking branches 'asoc/topic/da7213', 'asoc/topic/da732x', 'asoc/topic/da9055', 'asoc/topic/davinci', 'asoc/topic/fsl', 'asoc/topic/fsl-esai', 'asoc/topic/fsl-sai' and 'asoc/topic/fsl-spdif' into asoc-next 2014-03-12 23:04:22 +00:00
au1x ASoC: au1x: Don't set unused struct snd_pcm_hardware fields 2013-12-21 14:23:20 +00:00
bcm ASoC: bcm: Remove obsoleted Kconfig dependency 2014-01-08 20:00:04 +00:00
blackfin Merge remote-tracking branches 'asoc/topic/samsung', 'asoc/topic/sgtl5000', 'asoc/topic/sh', 'asoc/topic/simple', 'asoc/topic/sirf', 'asoc/topic/sn95031', 'asoc/topic/ssm2602' and 'asoc/topic/stac9766' into asoc-next 2014-03-12 23:04:42 +00:00
cirrus Merge remote-tracking branch 'asoc/topic/cirrus' into asoc-next 2014-03-13 14:19:11 +00:00
codecs Merge branches 'topic/sta350', 'topic/core', 'topic/dapm' and 'topic/cache' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-component 2014-04-22 13:22:52 +01:00
davinci ASoC: davinci-mcasp: Fix bit clock polarity settings 2014-04-08 12:56:45 +01:00
dwc ASoC: designware_i2s: Remove unnecessary dev_set_drvdata() 2013-08-29 13:18:32 +01:00
fsl Merge remote-tracking branches 'asoc/fix/alc5632', 'asoc/fix/cs42l52', 'asoc/fix/cs42xxx8', 'asoc/fix/da732x', 'asoc/fix/davinci', 'asoc/fix/fsl-sai', 'asoc/fix/fsl-ssi' and 'asoc/fix/max98090' into asoc-linus 2014-04-08 21:22:11 +01:00
generic ASoC: simple-card: Handle many DAI links 2014-03-25 18:09:20 +00:00
intel ASoC: Add snd_soc_kcontrol_platform() helper function 2014-04-14 17:22:43 +01:00
jz4740 ASoC: jz4740: Use the generic dmaengine PCM driver 2013-12-03 18:07:49 +00:00
kirkwood ARM: SoC: driver changes 2014-04-05 15:37:40 -07:00
mxs Merge remote-tracking branches 'asoc/topic/adsp', 'asoc/topic/atmel', 'asoc/topic/bcm2835', 'asoc/topic/docs', 'asoc/topic/fsl', 'asoc/topic/generic', 'asoc/topic/kirkwood', 'asoc/topic/mc13783', 'asoc/topic/mxs', 'asoc/topic/nuc900', 'asoc/topic/sai', 'asoc/topic/sh', 'asoc/topic/ssm2602', 'asoc/topic/tlv320aic3x', 'asoc/topic/twl4030', 'asoc/topic/ux500', 'asoc/topic/width' and 'asoc/topic/x86' into for-tiwai 2014-01-16 12:44:01 +00:00
nuc900 ASoC: nuc900: Don't set unused struct snd_pcm_hardware fields 2014-01-09 14:29:02 +00:00
omap Merge remote-tracking branches 'asoc/topic/max98090' and 'asoc/topic/omap' into asoc-next 2014-03-23 14:00:55 +00:00
pxa ASoC: pxa: tosa: Convert to table based DAPM and control setup 2014-03-13 09:41:00 +00:00
s6000 ASoC: s6105-ipcam: Convert to table based DAPM setup 2014-03-13 11:43:30 +00:00
samsung ASoC: samsung: Fix build on multiplatform 2014-04-08 12:51:57 +01:00
sh Merge remote-tracking branch 'asoc/topic/rcar' into asoc-next 2014-03-24 11:16:43 +00:00
sirf ASoC: sirf: Add SiRF audio card 2014-03-06 17:21:56 +08:00
spear ASoC: spear: spdif_out: Fix mute control 2014-03-10 17:43:15 +00:00
tegra Merge remote-tracking branches 'asoc/topic/tdm' and 'asoc/topic/tegra' into asoc-next 2014-03-25 21:22:15 +00:00
txx9 ASoC: txx9aclc_ac97: Fix kernel crash on probe 2014-02-16 08:36:40 +08:00
ux500 ASoC: ux500: Don't set unused struct snd_pcm_hardware fields 2014-01-09 14:30:27 +00:00
Kconfig ASoC: sirf: Add SiRF audio port driver is used by SiRF internal audio codec 2014-03-06 17:20:08 +08:00
Makefile ASoC: sirf: Add SiRF audio port driver is used by SiRF internal audio codec 2014-03-06 17:20:08 +08:00
soc-cache.c ASoC: Remove IO register modifier callbacks 2014-04-14 17:22:43 +01:00
soc-compress.c ASoC: Add helper functions for PCM runtime 'active' management 2014-03-06 17:04:55 +08:00
soc-core.c ASoC: core: Fix component_list corruption when unloading modules 2014-04-29 10:09:11 -07:00
soc-dapm.c ASoC: dapm: Rename soc_widget_update_bits_locked() to soc_widget_update_bits() 2014-04-22 13:24:24 +01:00
soc-devres.c Merge remote-tracking branch 'asoc/topic/dma' into asoc-next 2014-01-02 13:01:52 +00:00
soc-generic-dmaengine-pcm.c ASoC: core: Fix possible NULL pointer dereference of pcm->config 2014-01-16 14:11:49 +00:00
soc-io.c ASoC: Remove ASoC level IO tracing 2014-04-22 13:24:24 +01:00
soc-jack.c ASoC: delay the initial jack detect by debounce_time 2014-02-24 10:27:47 +09:00
soc-pcm.c ASoC: Updates for v3.15 2014-03-23 14:00:41 +00:00
soc-utils.c Merge remote-tracking branch 'asoc/topic/dapm' into for-tiwai 2014-01-16 12:42:53 +00:00