From: Lucas Tanure Date: Sat, 6 Mar 2021 18:55:44 +0000 (+0000) Subject: ASoC: cs42l42: Remove power if the driver is being removed X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=2b869e0ea598263e0fd60872430899fa0660b2fa;p=uclinux-h8%2Flinux.git ASoC: cs42l42: Remove power if the driver is being removed Ensure the power supplies are turned off when removing the driver Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20210306185553.62053-7-tanureal@opensource.cirrus.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c index 811b7b1c9732..f61404de139b 100644 --- a/sound/soc/codecs/cs42l42.c +++ b/sound/soc/codecs/cs42l42.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -1842,8 +1843,9 @@ static int cs42l42_i2c_remove(struct i2c_client *i2c_client) { struct cs42l42_private *cs42l42 = i2c_get_clientdata(i2c_client); - /* Hold down reset */ - gpiod_set_value_cansleep(cs42l42->reset_gpio, 0); + devm_free_irq(&i2c_client->dev, i2c_client->irq, cs42l42); + pm_runtime_suspend(&i2c_client->dev); + pm_runtime_disable(&i2c_client->dev); return 0; }