Commit 2dab09be authored by Chuhong Yuan's avatar Chuhong Yuan Committed by Mark Brown

ASoC: wm2200: add missed operations in remove and probe failure

This driver misses calls to pm_runtime_disable and regulator_bulk_disable
in remove and a call to free_irq in probe failure.
Add the calls to fix it.
Signed-off-by: default avatarChuhong Yuan <hslester96@gmail.com>
Link: https://lore.kernel.org/r/20191118073633.28237-1-hslester96@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent baddcee9
...@@ -2410,6 +2410,8 @@ static int wm2200_i2c_probe(struct i2c_client *i2c, ...@@ -2410,6 +2410,8 @@ static int wm2200_i2c_probe(struct i2c_client *i2c,
err_pm_runtime: err_pm_runtime:
pm_runtime_disable(&i2c->dev); pm_runtime_disable(&i2c->dev);
if (i2c->irq)
free_irq(i2c->irq, wm2200);
err_reset: err_reset:
if (wm2200->pdata.reset) if (wm2200->pdata.reset)
gpio_set_value_cansleep(wm2200->pdata.reset, 0); gpio_set_value_cansleep(wm2200->pdata.reset, 0);
...@@ -2426,12 +2428,15 @@ static int wm2200_i2c_remove(struct i2c_client *i2c) ...@@ -2426,12 +2428,15 @@ static int wm2200_i2c_remove(struct i2c_client *i2c)
{ {
struct wm2200_priv *wm2200 = i2c_get_clientdata(i2c); struct wm2200_priv *wm2200 = i2c_get_clientdata(i2c);
pm_runtime_disable(&i2c->dev);
if (i2c->irq) if (i2c->irq)
free_irq(i2c->irq, wm2200); free_irq(i2c->irq, wm2200);
if (wm2200->pdata.reset) if (wm2200->pdata.reset)
gpio_set_value_cansleep(wm2200->pdata.reset, 0); gpio_set_value_cansleep(wm2200->pdata.reset, 0);
if (wm2200->pdata.ldo_ena) if (wm2200->pdata.ldo_ena)
gpio_set_value_cansleep(wm2200->pdata.ldo_ena, 0); gpio_set_value_cansleep(wm2200->pdata.ldo_ena, 0);
regulator_bulk_disable(ARRAY_SIZE(wm2200->core_supplies),
wm2200->core_supplies);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment