]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: tegra20: Convert to RUNTIME_PM_OPS() & co
authorTakashi Iwai <tiwai@suse.de>
Mon, 17 Mar 2025 09:55:46 +0000 (10:55 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 17 Mar 2025 10:15:01 +0000 (10:15 +0000)
Use the newer RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() macros
instead of SET_RUNTIME_PM_OPS() and SET_SYSTEM_SLEEP_PM_OPS() together
with pm_ptr(), which allows us dropping ugly __maybe_unused
attributes.

This optimizes slightly when CONFIG_PM is disabled, too.

Cc: linux-tegra@vger.kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250317095603.20073-85-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/tegra/tegra20_i2s.c
sound/soc/tegra/tegra20_spdif.c

index 3b9823d1a87a133f9c016f547396668984b3294d..51df0835ce3ecabbb878833622abdb2db5125707 100644 (file)
@@ -34,7 +34,7 @@
 
 #define DRV_NAME "tegra20-i2s"
 
-static __maybe_unused int tegra20_i2s_runtime_suspend(struct device *dev)
+static int tegra20_i2s_runtime_suspend(struct device *dev)
 {
        struct tegra20_i2s *i2s = dev_get_drvdata(dev);
 
@@ -45,7 +45,7 @@ static __maybe_unused int tegra20_i2s_runtime_suspend(struct device *dev)
        return 0;
 }
 
-static __maybe_unused int tegra20_i2s_runtime_resume(struct device *dev)
+static int tegra20_i2s_runtime_resume(struct device *dev)
 {
        struct tegra20_i2s *i2s = dev_get_drvdata(dev);
        int ret;
@@ -487,17 +487,16 @@ static const struct of_device_id tegra20_i2s_of_match[] = {
 };
 
 static const struct dev_pm_ops tegra20_i2s_pm_ops = {
-       SET_RUNTIME_PM_OPS(tegra20_i2s_runtime_suspend,
-                          tegra20_i2s_runtime_resume, NULL)
-       SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-                               pm_runtime_force_resume)
+       RUNTIME_PM_OPS(tegra20_i2s_runtime_suspend,
+                      tegra20_i2s_runtime_resume, NULL)
+       SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
 };
 
 static struct platform_driver tegra20_i2s_driver = {
        .driver = {
                .name = DRV_NAME,
                .of_match_table = tegra20_i2s_of_match,
-               .pm = &tegra20_i2s_pm_ops,
+               .pm = pm_ptr(&tegra20_i2s_pm_ops),
        },
        .probe = tegra20_i2s_platform_probe,
        .remove = tegra20_i2s_platform_remove,
index 380011233eb12fb4c835fd16ff81fd3c527a42cc..38661d9b4a7c1552862e227deb33322116e4e531 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "tegra20_spdif.h"
 
-static __maybe_unused int tegra20_spdif_runtime_suspend(struct device *dev)
+static int tegra20_spdif_runtime_suspend(struct device *dev)
 {
        struct tegra20_spdif *spdif = dev_get_drvdata(dev);
 
@@ -36,7 +36,7 @@ static __maybe_unused int tegra20_spdif_runtime_suspend(struct device *dev)
        return 0;
 }
 
-static __maybe_unused int tegra20_spdif_runtime_resume(struct device *dev)
+static int tegra20_spdif_runtime_resume(struct device *dev)
 {
        struct tegra20_spdif *spdif = dev_get_drvdata(dev);
        int ret;
@@ -403,10 +403,9 @@ static int tegra20_spdif_platform_probe(struct platform_device *pdev)
 }
 
 static const struct dev_pm_ops tegra20_spdif_pm_ops = {
-       SET_RUNTIME_PM_OPS(tegra20_spdif_runtime_suspend,
-                          tegra20_spdif_runtime_resume, NULL)
-       SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-                               pm_runtime_force_resume)
+       RUNTIME_PM_OPS(tegra20_spdif_runtime_suspend,
+                      tegra20_spdif_runtime_resume, NULL)
+       SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
 };
 
 static const struct of_device_id tegra20_spdif_of_match[] = {
@@ -418,7 +417,7 @@ MODULE_DEVICE_TABLE(of, tegra20_spdif_of_match);
 static struct platform_driver tegra20_spdif_driver = {
        .driver = {
                .name = "tegra20-spdif",
-               .pm = &tegra20_spdif_pm_ops,
+               .pm = pm_ptr(&tegra20_spdif_pm_ops),
                .of_match_table = tegra20_spdif_of_match,
        },
        .probe = tegra20_spdif_platform_probe,