]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: wm8804: Convert to EXPORT_GPL_DEV_PM_OPS()
authorTakashi Iwai <tiwai@suse.de>
Mon, 17 Mar 2025 09:55:14 +0000 (10:55 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 17 Mar 2025 10:14:33 +0000 (10:14 +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: patches@opensource.cirrus.com
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250317095603.20073-53-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wm8804-i2c.c
sound/soc/codecs/wm8804-spi.c
sound/soc/codecs/wm8804.c

index e80dad87219b16bd6765cbbe9aea679b5dc57748..3380d7301b178b9c6cac4be47d6154f74b865ffc 100644 (file)
@@ -56,7 +56,7 @@ MODULE_DEVICE_TABLE(acpi, wm8804_acpi_match);
 static struct i2c_driver wm8804_i2c_driver = {
        .driver = {
                .name = "wm8804",
-               .pm = &wm8804_pm,
+               .pm = pm_ptr(&wm8804_pm),
                .of_match_table = of_match_ptr(wm8804_of_match),
                .acpi_match_table = ACPI_PTR(wm8804_acpi_match),
        },
index 628568724c200a63ba02282957f02406378012d5..cf74abfb1a2c70d40e7b4a1334440728b7e02b3e 100644 (file)
@@ -38,7 +38,7 @@ MODULE_DEVICE_TABLE(of, wm8804_of_match);
 static struct spi_driver wm8804_spi_driver = {
        .driver = {
                .name = "wm8804",
-               .pm = &wm8804_pm,
+               .pm = pm_ptr(&wm8804_pm),
                .of_match_table = wm8804_of_match,
        },
        .probe = wm8804_spi_probe,
index 0a879c29eb0406efa16ed78f6e498f2664d2a3a6..48700cc25cb0846c79b42889794c648294faaf72 100644 (file)
@@ -680,7 +680,6 @@ void wm8804_remove(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(wm8804_remove);
 
-#if IS_ENABLED(CONFIG_PM)
 static int wm8804_runtime_resume(struct device *dev)
 {
        struct wm8804_priv *wm8804 = dev_get_drvdata(dev);
@@ -713,12 +712,10 @@ static int wm8804_runtime_suspend(struct device *dev)
 
        return 0;
 }
-#endif
 
-const struct dev_pm_ops wm8804_pm = {
-       SET_RUNTIME_PM_OPS(wm8804_runtime_suspend, wm8804_runtime_resume, NULL)
+EXPORT_GPL_DEV_PM_OPS(wm8804_pm) = {
+       RUNTIME_PM_OPS(wm8804_runtime_suspend, wm8804_runtime_resume, NULL)
 };
-EXPORT_SYMBOL_GPL(wm8804_pm);
 
 MODULE_DESCRIPTION("ASoC WM8804 driver");
 MODULE_AUTHOR("Dimitris Papastamos <dp@opensource.wolfsonmicro.com>");