]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: hda/tegra: Convert to RUNTIME_PM_OPS() & co
authorTakashi Iwai <tiwai@suse.de>
Thu, 13 Mar 2025 17:07:24 +0000 (18:07 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 14 Mar 2025 10:07:13 +0000 (11:07 +0100)
Use the newer RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() macros
instead of SET_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.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250313170731.26943-7-tiwai@suse.de
sound/pci/hda/hda_tegra.c

index b1e30a83dfb0cea007ab51c15587f03f323f9abd..a590d431c5ff6e8b7c79b1fe53c37b971ecdb3db 100644 (file)
@@ -125,7 +125,7 @@ static void hda_tegra_init(struct hda_tegra *hda)
 /*
  * power management
  */
-static int __maybe_unused hda_tegra_suspend(struct device *dev)
+static int hda_tegra_suspend(struct device *dev)
 {
        struct snd_card *card = dev_get_drvdata(dev);
        int rc;
@@ -138,7 +138,7 @@ static int __maybe_unused hda_tegra_suspend(struct device *dev)
        return 0;
 }
 
-static int __maybe_unused hda_tegra_resume(struct device *dev)
+static int hda_tegra_resume(struct device *dev)
 {
        struct snd_card *card = dev_get_drvdata(dev);
        int rc;
@@ -151,7 +151,7 @@ static int __maybe_unused hda_tegra_resume(struct device *dev)
        return 0;
 }
 
-static int __maybe_unused hda_tegra_runtime_suspend(struct device *dev)
+static int hda_tegra_runtime_suspend(struct device *dev)
 {
        struct snd_card *card = dev_get_drvdata(dev);
        struct azx *chip = card->private_data;
@@ -170,7 +170,7 @@ static int __maybe_unused hda_tegra_runtime_suspend(struct device *dev)
        return 0;
 }
 
-static int __maybe_unused hda_tegra_runtime_resume(struct device *dev)
+static int hda_tegra_runtime_resume(struct device *dev)
 {
        struct snd_card *card = dev_get_drvdata(dev);
        struct azx *chip = card->private_data;
@@ -204,10 +204,8 @@ static int __maybe_unused hda_tegra_runtime_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops hda_tegra_pm = {
-       SET_SYSTEM_SLEEP_PM_OPS(hda_tegra_suspend, hda_tegra_resume)
-       SET_RUNTIME_PM_OPS(hda_tegra_runtime_suspend,
-                          hda_tegra_runtime_resume,
-                          NULL)
+       SYSTEM_SLEEP_PM_OPS(hda_tegra_suspend, hda_tegra_resume)
+       RUNTIME_PM_OPS(hda_tegra_runtime_suspend, hda_tegra_runtime_resume, NULL)
 };
 
 static int hda_tegra_dev_disconnect(struct snd_device *device)
@@ -602,7 +600,7 @@ static void hda_tegra_shutdown(struct platform_device *pdev)
 static struct platform_driver tegra_platform_hda = {
        .driver = {
                .name = "tegra-hda",
-               .pm = &hda_tegra_pm,
+               .pm = pm_ptr(&hda_tegra_pm),
                .of_match_table = hda_tegra_match,
        },
        .probe = hda_tegra_probe,