ASoC: cs35l32: add missed regulator_bulk_disable in remove
diff mbox series

Message ID 20191206075146.18011-1-hslester96@gmail.com
State New
Headers show
Series
  • ASoC: cs35l32: add missed regulator_bulk_disable in remove
Related show

Commit Message

Chuhong Yuan Dec. 6, 2019, 7:51 a.m. UTC
The driver forgets to call regulator_bulk_disable() in remove like that
in probe failure.
Add the missed call to fix it.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
 sound/soc/codecs/cs35l32.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Mark Brown Dec. 9, 2019, 4:22 p.m. UTC | #1
On Fri, Dec 06, 2019 at 03:51:46PM +0800, Chuhong Yuan wrote:

> @@ -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.

Patch
diff mbox series

diff --git a/sound/soc/codecs/cs35l32.c b/sound/soc/codecs/cs35l32.c
index 3a644a35c464..be8159bd8ec8 100644
--- a/sound/soc/codecs/cs35l32.c
+++ b/sound/soc/codecs/cs35l32.c
@@ -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;
 }