ASoC: soc-core: Fix regression causing sysfs entries to disappear
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Thu, 30 Jul 2020 12:07:14 +0000 (13:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:24:04 +0000 (08:24 +0200)
commitd68e1b834b0cee5334ec0f8574be46bcbd408576
tree7eb6c7a80f937dedab15bd7c8a0b9e4c6f3c095a
parent557fa1da7dd849ec86b75878bd25518a952eb43a
ASoC: soc-core: Fix regression causing sysfs entries to disappear

[ Upstream commit 5c74c9d34aec1ac756de6979dd5580096aba8643 ]

The allocation order of things in soc_new_pcm_runtime was changed to
move the device_register before the allocation of the rtd structure.
This was to allow the rtd allocation to be managed by devm. However
currently the sysfs entries are added by device_register and their
visibility depends on variables within the rtd structure, this causes
the pmdown_time and dapm_widgets sysfs entries to be missing for all
rtds.

Correct this issue by manually calling device_add_groups after the
appropriate information is available.

Fixes: d918a37610b1 ("ASoC: soc-core: tidyup soc_new_pcm_runtime() alloc order")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200730120715.637-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/soc-core.c