Skip to content

Commit b5bfa72

Browse files
nunojsabroonie
authored andcommitted
ASoC: adau7118: don't disable regulators on device unbind
The regulators are supposed to be controlled through the set_bias_level() component callback. Moreover, the regulators are not enabled during probe and so, this would lead to a regulator unbalanced use count. Fixes: ca514c0 ("ASOC: Add ADAU7118 8 Channel PDM-to-I2S/TDM Converter driver") Signed-off-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20230224104551.1139981-1-nuno.sa@analog.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent b361d5d commit b5bfa72

1 file changed

Lines changed: 1 addition & 18 deletions

File tree

sound/soc/codecs/adau7118.c

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -444,22 +444,6 @@ static const struct snd_soc_component_driver adau7118_component_driver = {
444444
.endianness = 1,
445445
};
446446

447-
static void adau7118_regulator_disable(void *data)
448-
{
449-
struct adau7118_data *st = data;
450-
int ret;
451-
/*
452-
* If we fail to disable DVDD, don't bother in trying IOVDD. We
453-
* actually don't want to be left in the situation where DVDD
454-
* is enabled and IOVDD is disabled.
455-
*/
456-
ret = regulator_disable(st->dvdd);
457-
if (ret)
458-
return;
459-
460-
regulator_disable(st->iovdd);
461-
}
462-
463447
static int adau7118_regulator_setup(struct adau7118_data *st)
464448
{
465449
st->iovdd = devm_regulator_get(st->dev, "iovdd");
@@ -481,8 +465,7 @@ static int adau7118_regulator_setup(struct adau7118_data *st)
481465
regcache_cache_only(st->map, true);
482466
}
483467

484-
return devm_add_action_or_reset(st->dev, adau7118_regulator_disable,
485-
st);
468+
return 0;
486469
}
487470

488471
static int adau7118_parset_dt(const struct adau7118_data *st)

0 commit comments

Comments
 (0)