Skip to content

Commit

Permalink
ASoC: cs42l52: Minor tidy up of error paths
Browse files Browse the repository at this point in the history
Fixup a needlessly initialised variable and an unchecked return
value.

Reported-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Charles Keepax <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
charleskeepax authored and broonie committed May 12, 2021
1 parent b1078e9 commit 0e49a4d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sound/soc/codecs/cs42l56.c
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ static int cs42l56_i2c_probe(struct i2c_client *i2c_client,
struct cs42l56_platform_data *pdata =
dev_get_platdata(&i2c_client->dev);
int ret, i;
unsigned int devid = 0;
unsigned int devid;
unsigned int alpha_rev, metal_rev;
unsigned int reg;

Expand Down Expand Up @@ -1245,6 +1245,11 @@ static int cs42l56_i2c_probe(struct i2c_client *i2c_client,
}

ret = regmap_read(cs42l56->regmap, CS42L56_CHIP_ID_1, &reg);
if (ret) {
dev_err(&i2c_client->dev, "Failed to read chip ID: %d\n", ret);
return ret;
}

devid = reg & CS42L56_CHIP_ID_MASK;
if (devid != CS42L56_DEVID) {
dev_err(&i2c_client->dev,
Expand Down

0 comments on commit 0e49a4d

Please sign in to comment.