From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E4282C027B; Thu, 15 Jan 2026 17:22:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768497736; cv=none; b=M0XmTj5mSIURMs41a45LkcS0Wh6m+DOhUkyDAxeAV5QNHYfuClnFIfVPR8FZk33//8JX2Aun+sLnYWxSZraLW7Aq+cDwwIa/53c/ep7Bdxp+ULJlXISKX8nr7Ybx1vMXguX4YyKHjTIbiISAqxQUt+dTsWbTUVSbRfKoL2F+RKk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768497736; c=relaxed/simple; bh=zUjie7ePC7h5MQDZiMe3b2dJyzv9s03lhaZg0Svr2iU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=G9yOvNJ7CIxmAhvrDD59wdxDFbwJw7AMaWBjVKrvqo7Zv0wjdDnz3eMfTFOiPl+HdAyEwhSPUPKAbS0qDGcO2CHGm88xo8d9vMt6faVHBNG9kFHOAkz7cu3gyvxX1QlXfxw09oBOdOWUP2LOaiRYfK0QbuRVShlgP+ltxuRdIwk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=xf1e+IAV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="xf1e+IAV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2701C116D0; Thu, 15 Jan 2026 17:22:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1768497736; bh=zUjie7ePC7h5MQDZiMe3b2dJyzv9s03lhaZg0Svr2iU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xf1e+IAVlaYBe+KLogyuNzD8YDq96vCTzLwqpP6tyb258MMMjTouWxNeBoPd8e8c9 6UgKsvUfLK7asB/nTYK6QWsGOVjbhMemQsbU9pSB57fwVq6LvNSCWYLVo2QYFQGxmb 8JIoq7CzXxXMtBzs702IXJN1RFp700bRHUvBWrOY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Shengjiu Wang , Mark Brown , Sasha Levin Subject: [PATCH 5.15 186/554] ASoC: ak5558: Disable regulator when error happens Date: Thu, 15 Jan 2026 17:44:12 +0100 Message-ID: <20260115164252.994402429@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260115164246.225995385@linuxfoundation.org> References: <20260115164246.225995385@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shengjiu Wang [ Upstream commit 1f8f726a2a29c28f65b30880335a1610c5e63594 ] Disable regulator in runtime resume when error happens to balance the reference count of regulator. Fixes: 2ff6d5a108c6 ("ASoC: ak5558: Add regulator support") Signed-off-by: Shengjiu Wang Link: https://patch.msgid.link/20251203100529.3841203-3-shengjiu.wang@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/ak5558.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/ak5558.c b/sound/soc/codecs/ak5558.c index 37d4600b6f2c2..ba32cef2bf8ad 100644 --- a/sound/soc/codecs/ak5558.c +++ b/sound/soc/codecs/ak5558.c @@ -372,7 +372,15 @@ static int __maybe_unused ak5558_runtime_resume(struct device *dev) regcache_cache_only(ak5558->regmap, false); regcache_mark_dirty(ak5558->regmap); - return regcache_sync(ak5558->regmap); + ret = regcache_sync(ak5558->regmap); + if (ret) + goto err; + + return 0; +err: + regcache_cache_only(ak5558->regmap, true); + regulator_bulk_disable(ARRAY_SIZE(ak5558->supplies), ak5558->supplies); + return ret; } static const struct dev_pm_ops ak5558_pm = { -- 2.51.0