]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: es8328: Use cached regmap on resume
authorHsieh Hung-En <hungen3108@gmail.com>
Fri, 30 Jan 2026 16:00:16 +0000 (00:00 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 2 Feb 2026 12:50:02 +0000 (12:50 +0000)
Use the regmap stored in the driver private data when restoring the
register cache on resume, instead of looking it up from the device.

This keeps the resume path consistent with the regmap instance used by
the driver and avoids relying on a separate dev_get_regmap() lookup.

Signed-off-by: Hsieh Hung-En <hungen3108@gmail.com>
Link: https://patch.msgid.link/20260130160017.2630-5-hungen3108@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/es8328.c

index a18c3fe22da5a426ff139853b2a22c3661c98d65..7afc97c62587e51ab3d1daac8fb578f3eb2335c7 100644 (file)
@@ -771,12 +771,9 @@ static int es8328_suspend(struct snd_soc_component *component)
 
 static int es8328_resume(struct snd_soc_component *component)
 {
-       struct regmap *regmap = dev_get_regmap(component->dev, NULL);
-       struct es8328_priv *es8328;
+       struct es8328_priv *es8328 = snd_soc_component_get_drvdata(component);
        int ret;
 
-       es8328 = snd_soc_component_get_drvdata(component);
-
        ret = clk_prepare_enable(es8328->clk);
        if (ret) {
                dev_err(component->dev, "unable to enable clock\n");
@@ -790,8 +787,8 @@ static int es8328_resume(struct snd_soc_component *component)
                return ret;
        }
 
-       regcache_mark_dirty(regmap);
-       ret = regcache_sync(regmap);
+       regcache_mark_dirty(es8328->regmap);
+       ret = regcache_sync(es8328->regmap);
        if (ret) {
                dev_err(component->dev, "unable to sync regcache\n");
                return ret;