]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: uda1380: fix missing return value checks for I2C operations
authorWenyuan Li <2063309626@qq.com>
Tue, 24 Mar 2026 08:36:05 +0000 (16:36 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 24 Mar 2026 15:03:58 +0000 (15:03 +0000)
commit071efde6b7568fc3ce3b76d9e8c01e7b172539ad
treef7897fffdc5cbc1ad614a7d6810fa7028e04c9b4
parentc369299895a591d96745d6492d4888259b004a9e
ASoC: uda1380: fix missing return value checks for I2C operations

The driver currently ignores the return values of several I2C operations
during register writes, which could lead to silent failures and
inconsistent device state.

Fix this by:
- Moving variable declarations to the beginning of the function (C90).
- Checking the return value of every i2c_master_send() and recv() call.
- Returning the actual error code if it's negative, or -EIO if the
  transfer was incomplete.

Signed-off-by: Wenyuan Li <2063309626@qq.com>
Link: https://patch.msgid.link/tencent_579D057AC557914CF739A2D9EAD045CE7306@qq.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/uda1380.c