Skip to content

Commit 0e49a4d

Browse files
charleskeepaxbroonie
authored andcommitted
ASoC: cs42l52: Minor tidy up of error paths
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]>
1 parent b1078e9 commit 0e49a4d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sound/soc/codecs/cs42l56.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,7 @@ static int cs42l56_i2c_probe(struct i2c_client *i2c_client,
11751175
struct cs42l56_platform_data *pdata =
11761176
dev_get_platdata(&i2c_client->dev);
11771177
int ret, i;
1178-
unsigned int devid = 0;
1178+
unsigned int devid;
11791179
unsigned int alpha_rev, metal_rev;
11801180
unsigned int reg;
11811181

@@ -1245,6 +1245,11 @@ static int cs42l56_i2c_probe(struct i2c_client *i2c_client,
12451245
}
12461246

12471247
ret = regmap_read(cs42l56->regmap, CS42L56_CHIP_ID_1, &reg);
1248+
if (ret) {
1249+
dev_err(&i2c_client->dev, "Failed to read chip ID: %d\n", ret);
1250+
return ret;
1251+
}
1252+
12481253
devid = reg & CS42L56_CHIP_ID_MASK;
12491254
if (devid != CS42L56_DEVID) {
12501255
dev_err(&i2c_client->dev,

0 commit comments

Comments
 (0)