ASoC: compress: Clarify the intent of current compressed ops handling
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Tue, 5 Feb 2019 11:18:12 +0000 (11:18 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 6 Feb 2019 15:50:50 +0000 (15:50 +0000)
commit52cadf1fdbe87a3a3eee11d9cc4873796903c934
tree4830d17993296c4df81a861133d44a43afbea03b
parentd22b4117538d42f3dcf7e28210f07f968e46222e
ASoC: compress: Clarify the intent of current compressed ops handling

For callbacks configuring the state of the components (trigger,
set_params, ack and set_metadata) simplify the code a little and make
intention clearer by aborting as soon as an error is encountered. The
operation has already failed and there is nothing to be gained from
processing the callbacks on additional components. The operations
currently abort after the callbacks, so this simply shortens the
error path.

For callbacks returning information from the driver (copy,
get_metadata, pointer, get_codec_caps, get_caps and get_params)
only look for the first callback provided, currently the code will
call every callback only returning the information provided by the
last. Since we can only return one set of data, it makes no sense to
request the data from every component. Again this just makes the
currently supported feature set a little more clear.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-compress.c