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

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250317095603.20073-20-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/lpass-rx-macro.c
sound/soc/codecs/lpass-tx-macro.c
sound/soc/codecs/lpass-va-macro.c
sound/soc/codecs/lpass-wsa-macro.c

index febbbe0739628ee634d97c0f44d303d9a16ec807..45a6b83808b277344f17d35a70cd1e3bb89cbaea 100644 (file)
@@ -3963,7 +3963,7 @@ static const struct of_device_id rx_macro_dt_match[] = {
 };
 MODULE_DEVICE_TABLE(of, rx_macro_dt_match);
 
-static int __maybe_unused rx_macro_runtime_suspend(struct device *dev)
+static int rx_macro_runtime_suspend(struct device *dev)
 {
        struct rx_macro *rx = dev_get_drvdata(dev);
 
@@ -3977,7 +3977,7 @@ static int __maybe_unused rx_macro_runtime_suspend(struct device *dev)
        return 0;
 }
 
-static int __maybe_unused rx_macro_runtime_resume(struct device *dev)
+static int rx_macro_runtime_resume(struct device *dev)
 {
        struct rx_macro *rx = dev_get_drvdata(dev);
        int ret;
@@ -4012,7 +4012,7 @@ err_npl:
 }
 
 static const struct dev_pm_ops rx_macro_pm_ops = {
-       SET_RUNTIME_PM_OPS(rx_macro_runtime_suspend, rx_macro_runtime_resume, NULL)
+       RUNTIME_PM_OPS(rx_macro_runtime_suspend, rx_macro_runtime_resume, NULL)
 };
 
 static struct platform_driver rx_macro_driver = {
@@ -4020,7 +4020,7 @@ static struct platform_driver rx_macro_driver = {
                .name = "rx_macro",
                .of_match_table = rx_macro_dt_match,
                .suppress_bind_attrs = true,
-               .pm = &rx_macro_pm_ops,
+               .pm = pm_ptr(&rx_macro_pm_ops),
        },
        .probe = rx_macro_probe,
        .remove = rx_macro_remove,
index a134584acf909e0028953462defc4fd5b5dab7ea..27bae58f40725317682411f4cc97b8b456dd6676 100644 (file)
@@ -2400,7 +2400,7 @@ static void tx_macro_remove(struct platform_device *pdev)
        lpass_macro_pds_exit(tx->pds);
 }
 
-static int __maybe_unused tx_macro_runtime_suspend(struct device *dev)
+static int tx_macro_runtime_suspend(struct device *dev)
 {
        struct tx_macro *tx = dev_get_drvdata(dev);
 
@@ -2414,7 +2414,7 @@ static int __maybe_unused tx_macro_runtime_suspend(struct device *dev)
        return 0;
 }
 
-static int __maybe_unused tx_macro_runtime_resume(struct device *dev)
+static int tx_macro_runtime_resume(struct device *dev)
 {
        struct tx_macro *tx = dev_get_drvdata(dev);
        int ret;
@@ -2450,7 +2450,7 @@ err_npl:
 }
 
 static const struct dev_pm_ops tx_macro_pm_ops = {
-       SET_RUNTIME_PM_OPS(tx_macro_runtime_suspend, tx_macro_runtime_resume, NULL)
+       RUNTIME_PM_OPS(tx_macro_runtime_suspend, tx_macro_runtime_resume, NULL)
 };
 
 static const struct tx_macro_data lpass_ver_9 = {
@@ -2531,7 +2531,7 @@ static struct platform_driver tx_macro_driver = {
                .name = "tx_macro",
                .of_match_table = tx_macro_dt_match,
                .suppress_bind_attrs = true,
-               .pm = &tx_macro_pm_ops,
+               .pm = pm_ptr(&tx_macro_pm_ops),
        },
        .probe = tx_macro_probe,
        .remove = tx_macro_remove,
index c781da4762407e8e5cd1ddbf483b8dd8ad811c07..74ada6e77526005d05e200d958f14f260d1c0e08 100644 (file)
@@ -1674,7 +1674,7 @@ static void va_macro_remove(struct platform_device *pdev)
        lpass_macro_pds_exit(va->pds);
 }
 
-static int __maybe_unused va_macro_runtime_suspend(struct device *dev)
+static int va_macro_runtime_suspend(struct device *dev)
 {
        struct va_macro *va = dev_get_drvdata(dev);
 
@@ -1689,7 +1689,7 @@ static int __maybe_unused va_macro_runtime_suspend(struct device *dev)
        return 0;
 }
 
-static int __maybe_unused va_macro_runtime_resume(struct device *dev)
+static int va_macro_runtime_resume(struct device *dev)
 {
        struct va_macro *va = dev_get_drvdata(dev);
        int ret;
@@ -1717,7 +1717,7 @@ static int __maybe_unused va_macro_runtime_resume(struct device *dev)
 
 
 static const struct dev_pm_ops va_macro_pm_ops = {
-       SET_RUNTIME_PM_OPS(va_macro_runtime_suspend, va_macro_runtime_resume, NULL)
+       RUNTIME_PM_OPS(va_macro_runtime_suspend, va_macro_runtime_resume, NULL)
 };
 
 static const struct of_device_id va_macro_dt_match[] = {
@@ -1735,7 +1735,7 @@ static struct platform_driver va_macro_driver = {
                .name = "va_macro",
                .of_match_table = va_macro_dt_match,
                .suppress_bind_attrs = true,
-               .pm = &va_macro_pm_ops,
+               .pm = pm_ptr(&va_macro_pm_ops),
        },
        .probe = va_macro_probe,
        .remove = va_macro_remove,
index c989d82d1d3c1754427c721690057360e5e751a2..b261fa373e657af919b2e08d2bc6421bd331dc37 100644 (file)
@@ -2900,7 +2900,7 @@ static void wsa_macro_remove(struct platform_device *pdev)
        clk_disable_unprepare(wsa->fsgen);
 }
 
-static int __maybe_unused wsa_macro_runtime_suspend(struct device *dev)
+static int wsa_macro_runtime_suspend(struct device *dev)
 {
        struct wsa_macro *wsa = dev_get_drvdata(dev);
 
@@ -2914,7 +2914,7 @@ static int __maybe_unused wsa_macro_runtime_suspend(struct device *dev)
        return 0;
 }
 
-static int __maybe_unused wsa_macro_runtime_resume(struct device *dev)
+static int wsa_macro_runtime_resume(struct device *dev)
 {
        struct wsa_macro *wsa = dev_get_drvdata(dev);
        int ret;
@@ -2950,7 +2950,7 @@ err_npl:
 }
 
 static const struct dev_pm_ops wsa_macro_pm_ops = {
-       SET_RUNTIME_PM_OPS(wsa_macro_runtime_suspend, wsa_macro_runtime_resume, NULL)
+       RUNTIME_PM_OPS(wsa_macro_runtime_suspend, wsa_macro_runtime_resume, NULL)
 };
 
 static const struct of_device_id wsa_macro_dt_match[] = {
@@ -2977,7 +2977,7 @@ static struct platform_driver wsa_macro_driver = {
        .driver = {
                .name = "wsa_macro",
                .of_match_table = wsa_macro_dt_match,
-               .pm = &wsa_macro_pm_ops,
+               .pm = pm_ptr(&wsa_macro_pm_ops),
        },
        .probe = wsa_macro_probe,
        .remove = wsa_macro_remove,