]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: pcm3168a: Convert to EXPORT_GPL_DEV_PM_OPS()
authorTakashi Iwai <tiwai@suse.de>
Mon, 17 Mar 2025 09:55:50 +0000 (10:55 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 17 Mar 2025 10:15:05 +0000 (10:15 +0000)
Use the newer EXPORT_GPL_DEV_PM_OPS() macro together with pm_ptr(),
which allows us to drop superfluous CONFIG_PM ifdefs.

This optimizes slightly when CONFIG_PM is disabled, too.

Cc: Shenghao Ding <shenghao-ding@ti.com>
Cc: Kevin Lu <kevin-lu@ti.com>
Cc: Baojun Xu <baojun.xu@ti.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250317095603.20073-89-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/pcm3168a-i2c.c
sound/soc/codecs/pcm3168a-spi.c
sound/soc/codecs/pcm3168a.c

index 4da608ba514d16d6ba2e38e14726f07f39036d68..ff18c74b616c86b001febbd998280732bdea9967 100644 (file)
@@ -59,7 +59,7 @@ static struct i2c_driver pcm3168a_i2c_driver = {
                .name   = "pcm3168a",
                .acpi_match_table = pcm3168a_acpi_match,
                .of_match_table = pcm3168a_of_match,
-               .pm             = &pcm3168a_pm_ops,
+               .pm             = pm_ptr(&pcm3168a_pm_ops),
        },
 };
 module_i2c_driver(pcm3168a_i2c_driver);
index b5b08046f5454a56dd6ea5ef2e5f8e1fbf3bb717..0871338eacbafa7a7affb7f47bcdfc6fd277dc03 100644 (file)
@@ -50,7 +50,7 @@ static struct spi_driver pcm3168a_spi_driver = {
        .driver = {
                .name   = "pcm3168a",
                .of_match_table = pcm3168a_of_match,
-               .pm             = &pcm3168a_pm_ops,
+               .pm             = pm_ptr(&pcm3168a_pm_ops),
        },
 };
 module_spi_driver(pcm3168a_spi_driver);
index df6836a652ef26e0846b88a6bafca0b8cd5546cc..c8617a488b11c7c4850211c68038c9b4ac9fd5fb 100644 (file)
@@ -849,7 +849,6 @@ void pcm3168a_remove(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(pcm3168a_remove);
 
-#ifdef CONFIG_PM
 static int pcm3168a_rt_resume(struct device *dev)
 {
        struct pcm3168a_priv *pcm3168a = dev_get_drvdata(dev);
@@ -905,12 +904,10 @@ static int pcm3168a_rt_suspend(struct device *dev)
 
        return 0;
 }
-#endif
 
-const struct dev_pm_ops pcm3168a_pm_ops = {
-       SET_RUNTIME_PM_OPS(pcm3168a_rt_suspend, pcm3168a_rt_resume, NULL)
+EXPORT_GPL_DEV_PM_OPS(pcm3168a_pm_ops) = {
+       RUNTIME_PM_OPS(pcm3168a_rt_suspend, pcm3168a_rt_resume, NULL)
 };
-EXPORT_SYMBOL_GPL(pcm3168a_pm_ops);
 
 MODULE_DESCRIPTION("PCM3168A codec driver");
 MODULE_AUTHOR("Damien Horsley <Damien.Horsley@imgtec.com>");