]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ASoC: au1x: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
authorTakashi Iwai <tiwai@suse.de>
Mon, 17 Mar 2025 09:54:23 +0000 (10:54 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 17 Mar 2025 10:13:47 +0000 (10:13 +0000)
Use the new DEFINE_SIMPLE_DEV_PM_OPS() macro instead of open code
together with pm_ptr(), which allows us dropping CONFIG_PM ifdefs.

Merely a cleanup, there should be no actual code change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250317095603.20073-2-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/au1x/i2sc.c
sound/soc/au1x/psc-ac97.c
sound/soc/au1x/psc-i2s.c

index 7d296f29dade8c0c687557d896e2bd8ae6a2070b..57735004f41665869dda7c6e40f4da1a4156e105 100644 (file)
@@ -279,7 +279,6 @@ static void au1xi2s_drvremove(struct platform_device *pdev)
        WR(ctx, I2S_ENABLE, EN_D);      /* clock off, disable */
 }
 
-#ifdef CONFIG_PM
 static int au1xi2s_drvsuspend(struct device *dev)
 {
        struct au1xpsc_audio_data *ctx = dev_get_drvdata(dev);
@@ -294,23 +293,13 @@ static int au1xi2s_drvresume(struct device *dev)
        return 0;
 }
 
-static const struct dev_pm_ops au1xi2sc_pmops = {
-       .suspend        = au1xi2s_drvsuspend,
-       .resume         = au1xi2s_drvresume,
-};
-
-#define AU1XI2SC_PMOPS (&au1xi2sc_pmops)
-
-#else
-
-#define AU1XI2SC_PMOPS NULL
-
-#endif
+static DEFINE_SIMPLE_DEV_PM_OPS(au1xi2sc_pmops, au1xi2s_drvsuspend,
+                               au1xi2s_drvresume);
 
 static struct platform_driver au1xi2s_driver = {
        .driver = {
                .name   = "alchemy-i2sc",
-               .pm     = AU1XI2SC_PMOPS,
+               .pm     = pm_ptr(&au1xi2sc_pmops),
        },
        .probe          = au1xi2s_drvprobe,
        .remove         = au1xi2s_drvremove,
index 8a59a50978b91e2ad0a8ab752b5d515fa38e436b..94698e08a5134bd53698b023c9e47e15dc0db7a7 100644 (file)
@@ -436,7 +436,6 @@ static void au1xpsc_ac97_drvremove(struct platform_device *pdev)
        au1xpsc_ac97_workdata = NULL;   /* MDEV */
 }
 
-#ifdef CONFIG_PM
 static int au1xpsc_ac97_drvsuspend(struct device *dev)
 {
        struct au1xpsc_audio_data *wd = dev_get_drvdata(dev);
@@ -467,23 +466,13 @@ static int au1xpsc_ac97_drvresume(struct device *dev)
        return 0;
 }
 
-static const struct dev_pm_ops au1xpscac97_pmops = {
-       .suspend        = au1xpsc_ac97_drvsuspend,
-       .resume         = au1xpsc_ac97_drvresume,
-};
-
-#define AU1XPSCAC97_PMOPS &au1xpscac97_pmops
-
-#else
-
-#define AU1XPSCAC97_PMOPS NULL
-
-#endif
+static DEFINE_SIMPLE_DEV_PM_OPS(au1xpscac97_pmops, au1xpsc_ac97_drvsuspend,
+                               au1xpsc_ac97_drvresume);
 
 static struct platform_driver au1xpsc_ac97_driver = {
        .driver = {
                .name   = "au1xpsc_ac97",
-               .pm     = AU1XPSCAC97_PMOPS,
+               .pm     = pm_ptr(&au1xpscac97_pmops),
        },
        .probe          = au1xpsc_ac97_drvprobe,
        .remove         = au1xpsc_ac97_drvremove,
index bee013555e7a3583d1d6ad0e610e8ece213a5323..bf59105fcb7a66eb43b05f505997613866f7e760 100644 (file)
@@ -354,7 +354,6 @@ static void au1xpsc_i2s_drvremove(struct platform_device *pdev)
        wmb(); /* drain writebuffer */
 }
 
-#ifdef CONFIG_PM
 static int au1xpsc_i2s_drvsuspend(struct device *dev)
 {
        struct au1xpsc_audio_data *wd = dev_get_drvdata(dev);
@@ -385,23 +384,13 @@ static int au1xpsc_i2s_drvresume(struct device *dev)
        return 0;
 }
 
-static const struct dev_pm_ops au1xpsci2s_pmops = {
-       .suspend        = au1xpsc_i2s_drvsuspend,
-       .resume         = au1xpsc_i2s_drvresume,
-};
-
-#define AU1XPSCI2S_PMOPS &au1xpsci2s_pmops
-
-#else
-
-#define AU1XPSCI2S_PMOPS NULL
-
-#endif
+static DEFINE_SIMPLE_DEV_PM_OPS(au1xpsci2s_pmops, au1xpsc_i2s_drvsuspend,
+                               au1xpsc_i2s_drvresume);
 
 static struct platform_driver au1xpsc_i2s_driver = {
        .driver         = {
                .name   = "au1xpsc_i2s",
-               .pm     = AU1XPSCI2S_PMOPS,
+               .pm     = pm_ptr(&au1xpsci2s_pmops),
        },
        .probe          = au1xpsc_i2s_drvprobe,
        .remove         = au1xpsc_i2s_drvremove,