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

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: rt5645: check return value after reading device id

If the I2C controller encounters some problems like timed-out, the codec
driver will report the error code for the first read.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Link: https://lore.kernel.org/r/20230705042915.24932-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Shuming Fan and committed by
Mark Brown
bf62eec5 d9ba2975

+5 -1
+5 -1
sound/soc/codecs/rt5645.c
··· 3950 3950 * read and power On. 3951 3951 */ 3952 3952 msleep(TIME_TO_POWER_MS); 3953 - regmap_read(regmap, RT5645_VENDOR_ID2, &val); 3953 + ret = regmap_read(regmap, RT5645_VENDOR_ID2, &val); 3954 + if (ret < 0) { 3955 + dev_err(&i2c->dev, "Failed to read: 0x%02X\n, ret = %d", RT5645_VENDOR_ID2, ret); 3956 + goto err_enable; 3957 + } 3954 3958 3955 3959 switch (val) { 3956 3960 case RT5645_DEVICE_ID: