Skip to content

Commit b7055fc

Browse files
tiwaibroonie
authored andcommitted
ASoC: tegra20: 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 083c6a6 commit b7055fc

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

sound/soc/tegra/tegra20_i2s.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
#define DRV_NAME "tegra20-i2s"
3636

37-
static __maybe_unused int tegra20_i2s_runtime_suspend(struct device *dev)
37+
static int tegra20_i2s_runtime_suspend(struct device *dev)
3838
{
3939
struct tegra20_i2s *i2s = dev_get_drvdata(dev);
4040

@@ -45,7 +45,7 @@ static __maybe_unused int tegra20_i2s_runtime_suspend(struct device *dev)
4545
return 0;
4646
}
4747

48-
static __maybe_unused int tegra20_i2s_runtime_resume(struct device *dev)
48+
static int tegra20_i2s_runtime_resume(struct device *dev)
4949
{
5050
struct tegra20_i2s *i2s = dev_get_drvdata(dev);
5151
int ret;
@@ -487,17 +487,16 @@ static const struct of_device_id tegra20_i2s_of_match[] = {
487487
};
488488

489489
static const struct dev_pm_ops tegra20_i2s_pm_ops = {
490-
SET_RUNTIME_PM_OPS(tegra20_i2s_runtime_suspend,
491-
tegra20_i2s_runtime_resume, NULL)
492-
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
493-
pm_runtime_force_resume)
490+
RUNTIME_PM_OPS(tegra20_i2s_runtime_suspend,
491+
tegra20_i2s_runtime_resume, NULL)
492+
SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
494493
};
495494

496495
static struct platform_driver tegra20_i2s_driver = {
497496
.driver = {
498497
.name = DRV_NAME,
499498
.of_match_table = tegra20_i2s_of_match,
500-
.pm = &tegra20_i2s_pm_ops,
499+
.pm = pm_ptr(&tegra20_i2s_pm_ops),
501500
},
502501
.probe = tegra20_i2s_platform_probe,
503502
.remove = tegra20_i2s_platform_remove,

sound/soc/tegra/tegra20_spdif.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
#include "tegra20_spdif.h"
2727

28-
static __maybe_unused int tegra20_spdif_runtime_suspend(struct device *dev)
28+
static int tegra20_spdif_runtime_suspend(struct device *dev)
2929
{
3030
struct tegra20_spdif *spdif = dev_get_drvdata(dev);
3131

@@ -36,7 +36,7 @@ static __maybe_unused int tegra20_spdif_runtime_suspend(struct device *dev)
3636
return 0;
3737
}
3838

39-
static __maybe_unused int tegra20_spdif_runtime_resume(struct device *dev)
39+
static int tegra20_spdif_runtime_resume(struct device *dev)
4040
{
4141
struct tegra20_spdif *spdif = dev_get_drvdata(dev);
4242
int ret;
@@ -403,10 +403,9 @@ static int tegra20_spdif_platform_probe(struct platform_device *pdev)
403403
}
404404

405405
static const struct dev_pm_ops tegra20_spdif_pm_ops = {
406-
SET_RUNTIME_PM_OPS(tegra20_spdif_runtime_suspend,
407-
tegra20_spdif_runtime_resume, NULL)
408-
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
409-
pm_runtime_force_resume)
406+
RUNTIME_PM_OPS(tegra20_spdif_runtime_suspend,
407+
tegra20_spdif_runtime_resume, NULL)
408+
SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
410409
};
411410

412411
static const struct of_device_id tegra20_spdif_of_match[] = {
@@ -418,7 +417,7 @@ MODULE_DEVICE_TABLE(of, tegra20_spdif_of_match);
418417
static struct platform_driver tegra20_spdif_driver = {
419418
.driver = {
420419
.name = "tegra20-spdif",
421-
.pm = &tegra20_spdif_pm_ops,
420+
.pm = pm_ptr(&tegra20_spdif_pm_ops),
422421
.of_match_table = tegra20_spdif_of_match,
423422
},
424423
.probe = tegra20_spdif_platform_probe,

0 commit comments

Comments
 (0)