Skip to contentSkip to conversation

ASoC: cs35l32: add missed regulator_bulk_disable in remove

PATCH In review Chuhong Yuan 2 participants 2 messages Dec 6, 2019 – Dec 9, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: cs35l32: add missed regulator_bulk_disable in remove

The driver forgets to call regulator_bulk_disable() in remove like that in probe failure.
Add the missed call to fix it.

---
 sound/soc/codecs/cs35l32.c | 2 ++
 1 file changed, 2 insertions(+)
sound/soc/codecs/cs35l32.c +2 -0
index 3a644a35c464..be8159bd8ec8 100644
@@ -501,6 +501,8 @@ static int cs35l32_i2c_remove(struct i2c_client *i2c_client)
 	/* Hold down reset */
 	gpiod_set_value_cansleep(cs35l32->reset_gpio, 0);
 
+	regulator_bulk_disable(ARRAY_SIZE(cs35l32->supplies),
+			       cs35l32->supplies);
 	return 0;
 }
 
Signature · 1 line
2.24.0
maintainer
#1 lore raw

sound/soc/codecs/cs35l32.c static int cs35l32_i2c_remove(struct i2c_client *i2c_client) · line 505

Quoted 6 lines · Chuhong Yuan
sound/soc/codecs/cs35l32.c +2 -0
@@ -501,6 +501,8 @@ static int cs35l32_i2c_remove(struct i2c_client *i2c_client)
 	/* Hold down reset */
 	gpiod_set_value_cansleep(cs35l32->reset_gpio, 0);
 
+	regulator_bulk_disable(ARRAY_SIZE(cs35l32->supplies),
+			       cs35l32->supplies);

This is a similar situation to the one Charles pointed out - the driver is using runtime PM to manage the regulators so unless the device is active when removed the regulators won't be enabled.