ASoC: mt6660: Convert to RUNTIME_PM_OPS()
authorTakashi Iwai <tiwai@suse.de>
Mon, 17 Mar 2025 09:54:49 +0000 (10:54 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 17 Mar 2025 10:14:10 +0000 (10:14 +0000)
Use the newer RUNTIME_PM_OPS() macro instead of SET_RUNTIME_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>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250317095603.20073-28-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/mt6660.c

index 39a57f643d8146884613aca93f57227ce17ae66f..d16bccebae52a2bab9da5479232447785f9540c1 100644 (file)
@@ -529,7 +529,7 @@ static void mt6660_i2c_remove(struct i2c_client *client)
        mutex_destroy(&chip->io_lock);
 }
 
-static int __maybe_unused mt6660_i2c_runtime_suspend(struct device *dev)
+static int mt6660_i2c_runtime_suspend(struct device *dev)
 {
        struct mt6660_chip *chip = dev_get_drvdata(dev);
 
@@ -538,7 +538,7 @@ static int __maybe_unused mt6660_i2c_runtime_suspend(struct device *dev)
                MT6660_REG_SYSTEM_CTRL, 0x01, 0x01);
 }
 
-static int __maybe_unused mt6660_i2c_runtime_resume(struct device *dev)
+static int mt6660_i2c_runtime_resume(struct device *dev)
 {
        struct mt6660_chip *chip = dev_get_drvdata(dev);
 
@@ -548,8 +548,7 @@ static int __maybe_unused mt6660_i2c_runtime_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops mt6660_dev_pm_ops = {
-       SET_RUNTIME_PM_OPS(mt6660_i2c_runtime_suspend,
-                          mt6660_i2c_runtime_resume, NULL)
+       RUNTIME_PM_OPS(mt6660_i2c_runtime_suspend, mt6660_i2c_runtime_resume, NULL)
 };
 
 static const struct of_device_id __maybe_unused mt6660_of_id[] = {
@@ -568,7 +567,7 @@ static struct i2c_driver mt6660_i2c_driver = {
        .driver = {
                .name = "mt6660",
                .of_match_table = of_match_ptr(mt6660_of_id),
-               .pm = &mt6660_dev_pm_ops,
+               .pm = pm_ptr(&mt6660_dev_pm_ops),
        },
        .probe = mt6660_i2c_probe,
        .remove = mt6660_i2c_remove,