diff options
author | Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> | 2019-02-08 14:45:20 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-02-08 17:18:49 +0100 |
commit | 0bb423f2eaafedf89715c482a543dcd629ba3946 (patch) | |
tree | 87a45e601cda565f0c66fb46012c9409f7fc16a9 /sound/soc/codecs/tlv320aic31xx.c | |
parent | dt-bindings: sound: msm8916-wcd-analog: fix example regulator names (diff) | |
download | linux-0bb423f2eaafedf89715c482a543dcd629ba3946.tar.xz linux-0bb423f2eaafedf89715c482a543dcd629ba3946.zip |
ASoC: regulator notifier registration should be managed
Regulator notifiers, that were registered during codec driver probing,
must be unregistered during driver release, or device managed versions
have to be used. This patch fixes codec drivers, that weren't explicitly
unregistering notifiers and simplifies those, that did that manually.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/tlv320aic31xx.c')
-rw-r--r-- | sound/soc/codecs/tlv320aic31xx.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/sound/soc/codecs/tlv320aic31xx.c b/sound/soc/codecs/tlv320aic31xx.c index c6048d95c6d3..c544a1e35f5e 100644 --- a/sound/soc/codecs/tlv320aic31xx.c +++ b/sound/soc/codecs/tlv320aic31xx.c @@ -1274,8 +1274,9 @@ static int aic31xx_codec_probe(struct snd_soc_component *component) aic31xx->disable_nb[i].nb.notifier_call = aic31xx_regulator_event; aic31xx->disable_nb[i].aic31xx = aic31xx; - ret = regulator_register_notifier(aic31xx->supplies[i].consumer, - &aic31xx->disable_nb[i].nb); + ret = devm_regulator_register_notifier( + aic31xx->supplies[i].consumer, + &aic31xx->disable_nb[i].nb); if (ret) { dev_err(component->dev, "Failed to request regulator notifier: %d\n", @@ -1298,19 +1299,8 @@ static int aic31xx_codec_probe(struct snd_soc_component *component) return 0; } -static void aic31xx_codec_remove(struct snd_soc_component *component) -{ - struct aic31xx_priv *aic31xx = snd_soc_component_get_drvdata(component); - int i; - - for (i = 0; i < ARRAY_SIZE(aic31xx->supplies); i++) - regulator_unregister_notifier(aic31xx->supplies[i].consumer, - &aic31xx->disable_nb[i].nb); -} - static const struct snd_soc_component_driver soc_codec_driver_aic31xx = { .probe = aic31xx_codec_probe, - .remove = aic31xx_codec_remove, .set_bias_level = aic31xx_set_bias_level, .controls = common31xx_snd_controls, .num_controls = ARRAY_SIZE(common31xx_snd_controls), |