summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/cs35l56-i2c.c
diff options
context:
space:
mode:
authorSimon Trimmer <simont@opensource.cirrus.com>2023-04-14 15:37:49 +0200
committerMark Brown <broonie@kernel.org>2023-04-17 13:55:47 +0200
commit7d72351a4ef6e1e763bccc24d43c44ffbe1a1555 (patch)
tree6794f4d830ca4a784d0ba94867e80b950599c0e5 /sound/soc/codecs/cs35l56-i2c.c
parentASoC: nau8825: Add delay control for input path (diff)
downloadlinux-7d72351a4ef6e1e763bccc24d43c44ffbe1a1555.tar.xz
linux-7d72351a4ef6e1e763bccc24d43c44ffbe1a1555.zip
ASoC: cs35l56: Rework IRQ allocation
The irq member was being set before calling the init function and then cs35l56_irq_request() was called only when the init was successful. However cs35l56_release() calls devm_free_irq() when the irq member is set and therefore if init() fails then this will cause an attempted free of an unallocated IRQ. Instead pass the desired IRQ number to the cs35l56_irq_request() function and set cs35l56->irq only when it has been successfully allocated. Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/168147949598.26.711670799488943454@mailman-core.alsa-project.org Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/cs35l56-i2c.c')
-rw-r--r--sound/soc/codecs/cs35l56-i2c.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sound/soc/codecs/cs35l56-i2c.c b/sound/soc/codecs/cs35l56-i2c.c
index 4b7f034a7670..295caad26224 100644
--- a/sound/soc/codecs/cs35l56-i2c.c
+++ b/sound/soc/codecs/cs35l56-i2c.c
@@ -27,7 +27,6 @@ static int cs35l56_i2c_probe(struct i2c_client *client)
return -ENOMEM;
cs35l56->dev = dev;
- cs35l56->irq = client->irq;
cs35l56->can_hibernate = true;
i2c_set_clientdata(client, cs35l56);
@@ -43,7 +42,7 @@ static int cs35l56_i2c_probe(struct i2c_client *client)
ret = cs35l56_init(cs35l56);
if (ret == 0)
- ret = cs35l56_irq_request(cs35l56);
+ ret = cs35l56_irq_request(cs35l56, client->irq);
if (ret < 0)
cs35l56_remove(cs35l56);