[PATCH 4/7] ASoC: rt5677: Report error if the ID register cannot be read

From: Yauhen Kharuzhy

Date: Tue Feb 10 2026 - 19:24:52 EST


To make error messages clearer, report if the ID register failed to be
read via I2C during probing.

Signed-off-by: Yauhen Kharuzhy <jekhor@xxxxxxxxx>
---
sound/soc/codecs/rt5677.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
index 6628c7ca5a8a..845385c1fb88 100644
--- a/sound/soc/codecs/rt5677.c
+++ b/sound/soc/codecs/rt5677.c
@@ -5602,7 +5602,13 @@ static int rt5677_i2c_probe(struct i2c_client *i2c)
return ret;
}

- regmap_read(rt5677->regmap, RT5677_VENDOR_ID2, &val);
+ ret = regmap_read(rt5677->regmap, RT5677_VENDOR_ID2, &val);
+ if (ret) {
+ dev_err(&i2c->dev,
+ "Failed to read ID register: %d\n", ret);
+ return -ENODEV;
+ }
+
if (val != RT5677_DEVICE_ID) {
dev_err(&i2c->dev,
"Device with ID register %#x is not rt5677\n", val);
--
2.51.0