]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ASoC: hdac_hdmi: Convert to RUNTIME_PM_OPS() & co
authorTakashi Iwai <tiwai@suse.de>
Mon, 17 Mar 2025 09:54:40 +0000 (10:54 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 17 Mar 2025 10:14:02 +0000 (10:14 +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 superfluous CONFIG_PM ifdefs.

This optimizes slightly when CONFIG_PM is disabled, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250317095603.20073-19-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/hdac_hdmi.c

index 3bea5d09219ae95ee0cf84b32bf11340dc40b259..1139a2754ca337fd08a1106aaec179f8e7fbcc21 100644 (file)
@@ -2032,7 +2032,6 @@ static void hdmi_codec_remove(struct snd_soc_component *component)
        pm_runtime_disable(&hdev->dev);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int hdmi_codec_resume(struct device *dev)
 {
        struct hdac_device *hdev = dev_to_hdac_dev(dev);
@@ -2055,9 +2054,6 @@ static int hdmi_codec_resume(struct device *dev)
        hdac_hdmi_present_sense_all_pins(hdev, hdmi, false);
        return 0;
 }
-#else
-#define hdmi_codec_resume NULL
-#endif
 
 static const struct snd_soc_component_driver hdmi_hda_codec = {
        .probe                  = hdmi_codec_probe,
@@ -2227,7 +2223,6 @@ static int hdac_hdmi_dev_remove(struct hdac_device *hdev)
        return 0;
 }
 
-#ifdef CONFIG_PM
 static int hdac_hdmi_runtime_suspend(struct device *dev)
 {
        struct hdac_device *hdev = dev_to_hdac_dev(dev);
@@ -2296,14 +2291,10 @@ static int hdac_hdmi_runtime_resume(struct device *dev)
 
        return 0;
 }
-#else
-#define hdac_hdmi_runtime_suspend NULL
-#define hdac_hdmi_runtime_resume NULL
-#endif
 
 static const struct dev_pm_ops hdac_hdmi_pm = {
-       SET_RUNTIME_PM_OPS(hdac_hdmi_runtime_suspend, hdac_hdmi_runtime_resume, NULL)
-       SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, hdmi_codec_resume)
+       RUNTIME_PM_OPS(hdac_hdmi_runtime_suspend, hdac_hdmi_runtime_resume, NULL)
+       SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, hdmi_codec_resume)
 };
 
 static const struct hda_device_id hdmi_list[] = {
@@ -2322,7 +2313,7 @@ MODULE_DEVICE_TABLE(hdaudio, hdmi_list);
 static struct hdac_driver hdmi_driver = {
        .driver = {
                .name   = "HDMI HDA Codec",
-               .pm = &hdac_hdmi_pm,
+               .pm = pm_ptr(&hdac_hdmi_pm),
        },
        .id_table       = hdmi_list,
        .probe          = hdac_hdmi_dev_probe,