Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: codecs: rt711: do not store status in state container

Driver in its update status callback stores Soundwire device status in
state container but it never uses it later. Simplify the code a bit.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Link: https://lore.kernel.org/r/20230518072753.7361-8-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org

authored by

Krzysztof Kozlowski and committed by
Mark Brown
22e15c18 8322947e

+1 -5
+1 -4
sound/soc/codecs/rt711-sdw.c
··· 319 319 { 320 320 struct rt711_priv *rt711 = dev_get_drvdata(&slave->dev); 321 321 322 - /* Update the status */ 323 - rt711->status = status; 324 - 325 322 if (status == SDW_SLAVE_UNATTACHED) 326 323 rt711->hw_init = false; 327 324 ··· 326 329 * Perform initialization only if slave status is present and 327 330 * hw_init flag is false 328 331 */ 329 - if (rt711->hw_init || rt711->status != SDW_SLAVE_ATTACHED) 332 + if (rt711->hw_init || status != SDW_SLAVE_ATTACHED) 330 333 return 0; 331 334 332 335 /* perform I/O transfers required for Slave initialization */
-1
sound/soc/codecs/rt711.h
··· 15 15 struct regmap *sdw_regmap; 16 16 struct snd_soc_component *component; 17 17 struct sdw_slave *slave; 18 - enum sdw_slave_status status; 19 18 struct sdw_bus_params params; 20 19 bool hw_init; 21 20 bool first_hw_init;