mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02:00
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:
parent
687f2679e8
commit
14848e6a80
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user