Skip to content

Commit 5f6e34c

Browse files
tiwaibroonie
authored andcommitted
ASoC: tegra186: Convert to RUNTIME_PM_OPS() & co
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 ugly __maybe_unused attributes. This optimizes slightly when CONFIG_PM is disabled, too. Cc: [email protected] Signed-off-by: Takashi Iwai <[email protected]> Reviewed-by: Charles Keepax <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 723b690 commit 5f6e34c

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

sound/soc/tegra/tegra186_asrc.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static void tegra186_asrc_lock_stream(struct tegra186_asrc *asrc,
7676
1);
7777
}
7878

79-
static int __maybe_unused tegra186_asrc_runtime_suspend(struct device *dev)
79+
static int tegra186_asrc_runtime_suspend(struct device *dev)
8080
{
8181
struct tegra186_asrc *asrc = dev_get_drvdata(dev);
8282

@@ -86,7 +86,7 @@ static int __maybe_unused tegra186_asrc_runtime_suspend(struct device *dev)
8686
return 0;
8787
}
8888

89-
static int __maybe_unused tegra186_asrc_runtime_resume(struct device *dev)
89+
static int tegra186_asrc_runtime_resume(struct device *dev)
9090
{
9191
struct tegra186_asrc *asrc = dev_get_drvdata(dev);
9292
int id;
@@ -1021,17 +1021,16 @@ static void tegra186_asrc_platform_remove(struct platform_device *pdev)
10211021
}
10221022

10231023
static const struct dev_pm_ops tegra186_asrc_pm_ops = {
1024-
SET_RUNTIME_PM_OPS(tegra186_asrc_runtime_suspend,
1025-
tegra186_asrc_runtime_resume, NULL)
1026-
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
1027-
pm_runtime_force_resume)
1024+
RUNTIME_PM_OPS(tegra186_asrc_runtime_suspend,
1025+
tegra186_asrc_runtime_resume, NULL)
1026+
SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
10281027
};
10291028

10301029
static struct platform_driver tegra186_asrc_driver = {
10311030
.driver = {
10321031
.name = "tegra186-asrc",
10331032
.of_match_table = tegra186_asrc_of_match,
1034-
.pm = &tegra186_asrc_pm_ops,
1033+
.pm = pm_ptr(&tegra186_asrc_pm_ops),
10351034
},
10361035
.probe = tegra186_asrc_platform_probe,
10371036
.remove = tegra186_asrc_platform_remove,

sound/soc/tegra/tegra186_dspk.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ static int tegra186_dspk_put_stereo_to_mono(struct snd_kcontrol *kcontrol,
181181
return 1;
182182
}
183183

184-
static int __maybe_unused tegra186_dspk_runtime_suspend(struct device *dev)
184+
static int tegra186_dspk_runtime_suspend(struct device *dev)
185185
{
186186
struct tegra186_dspk *dspk = dev_get_drvdata(dev);
187187

@@ -193,7 +193,7 @@ static int __maybe_unused tegra186_dspk_runtime_suspend(struct device *dev)
193193
return 0;
194194
}
195195

196-
static int __maybe_unused tegra186_dspk_runtime_resume(struct device *dev)
196+
static int tegra186_dspk_runtime_resume(struct device *dev)
197197
{
198198
struct tegra186_dspk *dspk = dev_get_drvdata(dev);
199199
int err;
@@ -532,17 +532,16 @@ static void tegra186_dspk_platform_remove(struct platform_device *pdev)
532532
}
533533

534534
static const struct dev_pm_ops tegra186_dspk_pm_ops = {
535-
SET_RUNTIME_PM_OPS(tegra186_dspk_runtime_suspend,
536-
tegra186_dspk_runtime_resume, NULL)
537-
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
538-
pm_runtime_force_resume)
535+
RUNTIME_PM_OPS(tegra186_dspk_runtime_suspend,
536+
tegra186_dspk_runtime_resume, NULL)
537+
SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
539538
};
540539

541540
static struct platform_driver tegra186_dspk_driver = {
542541
.driver = {
543542
.name = "tegra186-dspk",
544543
.of_match_table = tegra186_dspk_of_match,
545-
.pm = &tegra186_dspk_pm_ops,
544+
.pm = pm_ptr(&tegra186_dspk_pm_ops),
546545
},
547546
.probe = tegra186_dspk_platform_probe,
548547
.remove = tegra186_dspk_platform_remove,

0 commit comments

Comments
 (0)