From 636e75ee5f0889c87327823cfbfa894e8a5b2cf9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lothar=20Wa=C3=9Fmann?= Date: Thu, 17 Jul 2014 15:18:54 +0200 Subject: [PATCH] ASoC: sgtl5000: check whether regulator is enabled before disabling it --- sound/soc/codecs/sgtl5000.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 7449438095f9..c4b64da4d22f 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -806,6 +806,9 @@ static int ldo_regulator_disable(struct regulator_dev *dev) struct ldo_regulator *ldo = rdev_get_drvdata(dev); struct snd_soc_codec *codec = (struct snd_soc_codec *)ldo->codec_data; + if (ldo_regulator_is_enabled(dev)) + return 0; + snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER, SGTL5000_LINEREG_D_POWERUP, 0); -- 2.39.2