ASoC: cs43130: handle errors in cs43130_probe() properly
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 May 2021 11:57:24 +0000 (13:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Jun 2021 07:00:42 +0000 (09:00 +0200)
commit3bf09ab413c78ae30197a4b797ff0af764b8db9e
tree3093bee1fb480f6c2ee1add71c55911bc8639498
parentce333cc94e2a0ae89be5b48dfb757fcd2f9b06b6
ASoC: cs43130: handle errors in cs43130_probe() properly

[ Upstream commit 2da441a6491d93eff8ffff523837fd621dc80389 ]

cs43130_probe() does not do any valid error checking of things it
initializes, OR what it does, it does not unwind properly if there are
errors.

Fix this up by moving the sysfs files to an attribute group so the
driver core will correctly add/remove them all at once and handle errors
with them, and correctly check for creating a new workqueue and
unwinding if that fails.

Cc: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210503115736.2104747-58-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/codecs/cs43130.c