Skip to contentSkip to conversation

ASoC: wm5100: add missed regulator_bulk_disable

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

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

PATCH 1/1 ASoC: wm5100: add missed regulator_bulk_disable

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/wm5100.c | 2 ++
 1 file changed, 2 insertions(+)
sound/soc/codecs/wm5100.c +2 -0
index 91cc63c5a51f..d985b2061169 100644
@@ -2653,6 +2653,8 @@ static int wm5100_i2c_remove(struct i2c_client *i2c)
 		gpio_set_value_cansleep(wm5100->pdata.ldo_ena, 0);
 		gpio_free(wm5100->pdata.ldo_ena);
 	}
+	regulator_bulk_disable(ARRAY_SIZE(wm5100->core_supplies),
+			       wm5100->core_supplies);
 
 	return 0;
 }
Signature · 1 line
2.24.0
#1 lore raw
Quoted 14 lines · Chuhong Yuan

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/wm5100.c | 2 ++
 1 file changed, 2 insertions(+)
sound/soc/codecs/wm5100.c +0 -0
index 91cc63c5a51f..d985b2061169 100644

sound/soc/codecs/wm5100.c static int wm5100_i2c_remove(struct i2c_client *i2c) · line 2658

Quoted 6 lines
sound/soc/codecs/wm5100.c +2 -0
@@ -2653,6 +2653,8 @@ static int wm5100_i2c_remove(struct i2c_client *i2c)
 		gpio_set_value_cansleep(wm5100->pdata.ldo_ena, 0);
 		gpio_free(wm5100->pdata.ldo_ena);
 	}
+	regulator_bulk_disable(ARRAY_SIZE(wm5100->core_supplies),
+			       wm5100->core_supplies);
 

This is a bit trickier than this since these regulators are being controlled by PM runtime, and it doesn't necessarily leave things in an enabled state when it is disabled.

Thanks,
Charles