Skip to content

Commit 3b3312f

Browse files
rfvirgilbroonie
authored andcommitted
ASoC: cs35l56: probe() should fail if the device ID is not recognized
Return an error from driver probe if the DEVID read from the chip is not one supported by this driver. In cs35l56_hw_init() there is a check for valid DEVID, but the invalid case was returning the value of ret. At this point in the code ret == 0 so the caller would think that cs35l56_hw_init() was successful. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Fixes: 84851aa ("ASoC: cs35l56: Move part of cs35l56_init() to shared library") Link: https://patch.msgid.link/20250703102521.54204-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent f7690d0 commit 3b3312f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sound/soc/codecs/cs35l56-shared.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ int cs35l56_hw_init(struct cs35l56_base *cs35l56_base)
980980
break;
981981
default:
982982
dev_err(cs35l56_base->dev, "Unknown device %x\n", devid);
983-
return ret;
983+
return -ENODEV;
984984
}
985985

986986
cs35l56_base->type = devid & 0xFF;

0 commit comments

Comments
 (0)