Skip to content

Commit 212f5c4

Browse files
tiwaibroonie
authored andcommitted
ASoC: tegra30: 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 b7055fc commit 212f5c4

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

sound/soc/tegra/tegra30_ahub.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static inline void tegra30_audio_write(u32 reg, u32 val)
4040
regmap_write(ahub->regmap_ahub, reg, val);
4141
}
4242

43-
static __maybe_unused int tegra30_ahub_runtime_suspend(struct device *dev)
43+
static int tegra30_ahub_runtime_suspend(struct device *dev)
4444
{
4545
regcache_cache_only(ahub->regmap_apbif, true);
4646
regcache_cache_only(ahub->regmap_ahub, true);
@@ -61,7 +61,7 @@ static __maybe_unused int tegra30_ahub_runtime_suspend(struct device *dev)
6161
* stopping streams should dynamically adjust the clock as required. However,
6262
* this is not yet implemented.
6363
*/
64-
static __maybe_unused int tegra30_ahub_runtime_resume(struct device *dev)
64+
static int tegra30_ahub_runtime_resume(struct device *dev)
6565
{
6666
int ret;
6767

@@ -600,10 +600,9 @@ static void tegra30_ahub_remove(struct platform_device *pdev)
600600
}
601601

602602
static const struct dev_pm_ops tegra30_ahub_pm_ops = {
603-
SET_RUNTIME_PM_OPS(tegra30_ahub_runtime_suspend,
604-
tegra30_ahub_runtime_resume, NULL)
605-
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
606-
pm_runtime_force_resume)
603+
RUNTIME_PM_OPS(tegra30_ahub_runtime_suspend,
604+
tegra30_ahub_runtime_resume, NULL)
605+
SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
607606
};
608607

609608
static struct platform_driver tegra30_ahub_driver = {
@@ -612,7 +611,7 @@ static struct platform_driver tegra30_ahub_driver = {
612611
.driver = {
613612
.name = DRV_NAME,
614613
.of_match_table = tegra30_ahub_of_match,
615-
.pm = &tegra30_ahub_pm_ops,
614+
.pm = pm_ptr(&tegra30_ahub_pm_ops),
616615
},
617616
};
618617
module_platform_driver(tegra30_ahub_driver);

sound/soc/tegra/tegra30_i2s.c

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

3636
#define DRV_NAME "tegra30-i2s"
3737

38-
static __maybe_unused int tegra30_i2s_runtime_suspend(struct device *dev)
38+
static int tegra30_i2s_runtime_suspend(struct device *dev)
3939
{
4040
struct tegra30_i2s *i2s = dev_get_drvdata(dev);
4141

@@ -46,7 +46,7 @@ static __maybe_unused int tegra30_i2s_runtime_suspend(struct device *dev)
4646
return 0;
4747
}
4848

49-
static __maybe_unused int tegra30_i2s_runtime_resume(struct device *dev)
49+
static int tegra30_i2s_runtime_resume(struct device *dev)
5050
{
5151
struct tegra30_i2s *i2s = dev_get_drvdata(dev);
5252
int ret;
@@ -547,17 +547,16 @@ static void tegra30_i2s_platform_remove(struct platform_device *pdev)
547547
}
548548

549549
static const struct dev_pm_ops tegra30_i2s_pm_ops = {
550-
SET_RUNTIME_PM_OPS(tegra30_i2s_runtime_suspend,
551-
tegra30_i2s_runtime_resume, NULL)
552-
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
553-
pm_runtime_force_resume)
550+
RUNTIME_PM_OPS(tegra30_i2s_runtime_suspend,
551+
tegra30_i2s_runtime_resume, NULL)
552+
SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
554553
};
555554

556555
static struct platform_driver tegra30_i2s_driver = {
557556
.driver = {
558557
.name = DRV_NAME,
559558
.of_match_table = tegra30_i2s_of_match,
560-
.pm = &tegra30_i2s_pm_ops,
559+
.pm = pm_ptr(&tegra30_i2s_pm_ops),
561560
},
562561
.probe = tegra30_i2s_platform_probe,
563562
.remove = tegra30_i2s_platform_remove,

0 commit comments

Comments
 (0)