ASoC: rt5677: Report error if the ID register cannot be read

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

Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
Link: https://patch.msgid.link/20260211002255.4090440-5-jekhor@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Yauhen Kharuzhy 2026-02-11 02:18:36 +02:00 committed by Mark Brown
parent 687f2679e8
commit 14848e6a80
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -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);