diff options
| -rw-r--r-- | sound/soc/codecs/cs42xx8.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sound/soc/codecs/cs42xx8.c b/sound/soc/codecs/cs42xx8.c index 082299a4e2fa..85020322eee7 100644 --- a/sound/soc/codecs/cs42xx8.c +++ b/sound/soc/codecs/cs42xx8.c | |||
| @@ -495,17 +495,16 @@ int cs42xx8_probe(struct device *dev, struct regmap *regmap) | |||
| 495 | regcache_cache_bypass(cs42xx8->regmap, true); | 495 | regcache_cache_bypass(cs42xx8->regmap, true); |
| 496 | 496 | ||
| 497 | /* Validate the chip ID */ | 497 | /* Validate the chip ID */ |
| 498 | regmap_read(cs42xx8->regmap, CS42XX8_CHIPID, &val); | 498 | ret = regmap_read(cs42xx8->regmap, CS42XX8_CHIPID, &val); |
| 499 | if (val < 0) { | 499 | if (ret < 0) { |
| 500 | dev_err(dev, "failed to get device ID: %x", val); | 500 | dev_err(dev, "failed to get device ID, ret = %d", ret); |
| 501 | ret = -EINVAL; | ||
| 502 | goto err_enable; | 501 | goto err_enable; |
| 503 | } | 502 | } |
| 504 | 503 | ||
| 505 | /* The top four bits of the chip ID should be 0000 */ | 504 | /* The top four bits of the chip ID should be 0000 */ |
| 506 | if ((val & CS42XX8_CHIPID_CHIP_ID_MASK) != 0x00) { | 505 | if (((val & CS42XX8_CHIPID_CHIP_ID_MASK) >> 4) != 0x00) { |
| 507 | dev_err(dev, "unmatched chip ID: %d\n", | 506 | dev_err(dev, "unmatched chip ID: %d\n", |
| 508 | val & CS42XX8_CHIPID_CHIP_ID_MASK); | 507 | (val & CS42XX8_CHIPID_CHIP_ID_MASK) >> 4); |
| 509 | ret = -EINVAL; | 508 | ret = -EINVAL; |
| 510 | goto err_enable; | 509 | goto err_enable; |
| 511 | } | 510 | } |
