]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ASoC: codecs: wsa881x: Use designator array initializers for Soundwire ports
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Thu, 25 Jul 2024 11:23:43 +0000 (13:23 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 29 Jul 2024 00:41:16 +0000 (01:41 +0100)
commit874d04fe15d12cafa09dd36e8555cea4eb0653f6
tree8155cabb4e822e3a0ad3c22fb24bfaeb67a14329
parent8400291e289ee6b2bf9779ff1c83a291501f017b
ASoC: codecs: wsa881x: Use designator array initializers for Soundwire ports

Two arrays (with 'struct sdw_dpn_prop' and 'struct sdw_port_config')
store configuration of Soundwire ports, thus each of their element is
indexed according to the port number (enum wsa_port_ids, e.g.
WSA881X_PORT_DAC).  Except the indexing, they also store port number
offset by one in member 'num'.

Entire code depends on that correlation between array index and port
number, thus make it explicit by using designators.  The code is
functionally the same, but more obvious for reading.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://patch.msgid.link/20240725-asoc-wsa88xx-port-arrays-v1-1-80a03f440c72@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wsa881x.c