mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-27 14:14:24 +08:00
ALSA: hda: cs35l41: Don't return -EINVAL from system suspend/resume
The recent commit to support the system suspend for CS35L41 caused a
regression on the models with CS35L41_EXT_BOOST_NO_VSPK_SWITC boost
type, as the suspend/resume callbacks just return -EINVAL. This is
eventually handled as a fatal error and blocks the whole system
suspend/resume.
For avoiding the problem, this patch corrects the return code from
cs35l41_system_suspend() and _resume() to 0, and replace dev_err()
with dev_err_once() for stop spamming too much.
Fixes: 88672826e2
("ALSA: hda: cs35l41: Support System Suspend")
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/all/e6751ac2-34f3-d13f-13db-8174fade8308@pm.me
Link: https://lore.kernel.org/r/20230105093531.16960-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
9c694fbfe6
commit
15a59cb0a3
@ -598,8 +598,8 @@ static int cs35l41_system_suspend(struct device *dev)
|
|||||||
dev_dbg(cs35l41->dev, "System Suspend\n");
|
dev_dbg(cs35l41->dev, "System Suspend\n");
|
||||||
|
|
||||||
if (cs35l41->hw_cfg.bst_type == CS35L41_EXT_BOOST_NO_VSPK_SWITCH) {
|
if (cs35l41->hw_cfg.bst_type == CS35L41_EXT_BOOST_NO_VSPK_SWITCH) {
|
||||||
dev_err(cs35l41->dev, "System Suspend not supported\n");
|
dev_err_once(cs35l41->dev, "System Suspend not supported\n");
|
||||||
return -EINVAL;
|
return 0; /* don't block the whole system suspend */
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = pm_runtime_force_suspend(dev);
|
ret = pm_runtime_force_suspend(dev);
|
||||||
@ -624,8 +624,8 @@ static int cs35l41_system_resume(struct device *dev)
|
|||||||
dev_dbg(cs35l41->dev, "System Resume\n");
|
dev_dbg(cs35l41->dev, "System Resume\n");
|
||||||
|
|
||||||
if (cs35l41->hw_cfg.bst_type == CS35L41_EXT_BOOST_NO_VSPK_SWITCH) {
|
if (cs35l41->hw_cfg.bst_type == CS35L41_EXT_BOOST_NO_VSPK_SWITCH) {
|
||||||
dev_err(cs35l41->dev, "System Resume not supported\n");
|
dev_err_once(cs35l41->dev, "System Resume not supported\n");
|
||||||
return -EINVAL;
|
return 0; /* don't block the whole system resume */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cs35l41->reset_gpio) {
|
if (cs35l41->reset_gpio) {
|
||||||
|
Loading…
Reference in New Issue
Block a user