]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: rt5514: Convert to SYSTEM_SLEEP_PM_OPS()
authorTakashi Iwai <tiwai@suse.de>
Mon, 17 Mar 2025 09:54:56 +0000 (10:54 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 17 Mar 2025 10:14:17 +0000 (10:14 +0000)
Use the newer SYSTEM_SLEEP_PM_OPS() macro instead of
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: Oder Chiou <oder_chiou@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250317095603.20073-35-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt5514-spi.c
sound/soc/codecs/rt5514.c

index f475c8cfadae11246d301c5f20bfc2d4d44e4b17..54d84581ec475fb0f832e56ba850a0f98312a17f 100644 (file)
@@ -458,7 +458,7 @@ static int rt5514_spi_probe(struct spi_device *spi)
        return 0;
 }
 
-static int __maybe_unused rt5514_suspend(struct device *dev)
+static int rt5514_suspend(struct device *dev)
 {
        int irq = to_spi_device(dev)->irq;
 
@@ -468,7 +468,7 @@ static int __maybe_unused rt5514_suspend(struct device *dev)
        return 0;
 }
 
-static int __maybe_unused rt5514_resume(struct device *dev)
+static int rt5514_resume(struct device *dev)
 {
        struct rt5514_dsp *rt5514_dsp = dev_get_drvdata(dev);
        int irq = to_spi_device(dev)->irq;
@@ -490,7 +490,7 @@ static int __maybe_unused rt5514_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops rt5514_pm_ops = {
-       SET_SYSTEM_SLEEP_PM_OPS(rt5514_suspend, rt5514_resume)
+       SYSTEM_SLEEP_PM_OPS(rt5514_suspend, rt5514_resume)
 };
 
 static const struct of_device_id rt5514_of_match[] = {
@@ -502,7 +502,7 @@ MODULE_DEVICE_TABLE(of, rt5514_of_match);
 static struct spi_driver rt5514_spi_driver = {
        .driver = {
                .name = "rt5514",
-               .pm = &rt5514_pm_ops,
+               .pm = pm_ptr(&rt5514_pm_ops),
                .of_match_table = of_match_ptr(rt5514_of_match),
        },
        .probe = rt5514_spi_probe,
index a7f984b5d80fa40aa089adf27c3d34280aca0997..ab9d81c32be8effe96c7694408667279949f0c61 100644 (file)
@@ -1231,7 +1231,7 @@ static int rt5514_parse_dp(struct rt5514_priv *rt5514, struct device *dev)
        return 0;
 }
 
-static __maybe_unused int rt5514_i2c_resume(struct device *dev)
+static int rt5514_i2c_resume(struct device *dev)
 {
        struct rt5514_priv *rt5514 = dev_get_drvdata(dev);
        unsigned int val;
@@ -1313,7 +1313,7 @@ static int rt5514_i2c_probe(struct i2c_client *i2c)
 }
 
 static const struct dev_pm_ops rt5514_i2_pm_ops = {
-       SET_SYSTEM_SLEEP_PM_OPS(NULL, rt5514_i2c_resume)
+       SYSTEM_SLEEP_PM_OPS(NULL, rt5514_i2c_resume)
 };
 
 static struct i2c_driver rt5514_i2c_driver = {
@@ -1321,7 +1321,7 @@ static struct i2c_driver rt5514_i2c_driver = {
                .name = "rt5514",
                .acpi_match_table = ACPI_PTR(rt5514_acpi_match),
                .of_match_table = of_match_ptr(rt5514_of_match),
-               .pm = &rt5514_i2_pm_ops,
+               .pm = pm_ptr(&rt5514_i2_pm_ops),
        },
        .probe = rt5514_i2c_probe,
        .id_table = rt5514_i2c_id,