]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: max98390: Convert to SYSTEM_SLEEP_PM_OPS()
authorTakashi Iwai <tiwai@suse.de>
Mon, 17 Mar 2025 09:54:44 +0000 (10:54 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 17 Mar 2025 10:14:06 +0000 (10:14 +0000)
Use the newer SYSTEM_SLEEP_PM_OPS() macro instead of
SET_SYSTEM_SLEEP_PM_OPS() together with pm_ptr(), which allows us
dropping superfluous CONFIG_PM_SLEEP ifdefs.

This optimizes slightly when CONFIG_PM is disabled, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250317095603.20073-23-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/max98390.c

index 1bae253618fd07d2d796a47267829d42a3d14fe3..76296176f9486f72a9d6077a0c69a475e277ed88 100644 (file)
@@ -943,7 +943,6 @@ static int max98390_probe(struct snd_soc_component *component)
        return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int max98390_suspend(struct device *dev)
 {
        struct max98390_priv *max98390 = dev_get_drvdata(dev);
@@ -967,10 +966,9 @@ static int max98390_resume(struct device *dev)
 
        return 0;
 }
-#endif
 
 static const struct dev_pm_ops max98390_pm = {
-       SET_SYSTEM_SLEEP_PM_OPS(max98390_suspend, max98390_resume)
+       SYSTEM_SLEEP_PM_OPS(max98390_suspend, max98390_resume)
 };
 
 static const struct snd_soc_component_driver soc_codec_dev_max98390 = {
@@ -1130,7 +1128,7 @@ static struct i2c_driver max98390_i2c_driver = {
                .name = "max98390",
                .of_match_table = of_match_ptr(max98390_of_match),
                .acpi_match_table = ACPI_PTR(max98390_acpi_match),
-               .pm = &max98390_pm,
+               .pm = pm_ptr(&max98390_pm),
        },
        .probe = max98390_i2c_probe,
        .id_table = max98390_i2c_id,