Skip to content

Commit 083c6a6

Browse files
tiwaibroonie
authored andcommitted
ASoC: tegra210: 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 5f6e34c commit 083c6a6

File tree

10 files changed

+60
-70
lines changed

10 files changed

+60
-70
lines changed

sound/soc/tegra/tegra210_admaif.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ static const struct regmap_config tegra186_admaif_regmap_config = {
220220
.cache_type = REGCACHE_FLAT,
221221
};
222222

223-
static int __maybe_unused tegra_admaif_runtime_suspend(struct device *dev)
223+
static int tegra_admaif_runtime_suspend(struct device *dev)
224224
{
225225
struct tegra_admaif *admaif = dev_get_drvdata(dev);
226226

@@ -230,7 +230,7 @@ static int __maybe_unused tegra_admaif_runtime_suspend(struct device *dev)
230230
return 0;
231231
}
232232

233-
static int __maybe_unused tegra_admaif_runtime_resume(struct device *dev)
233+
static int tegra_admaif_runtime_resume(struct device *dev)
234234
{
235235
struct tegra_admaif *admaif = dev_get_drvdata(dev);
236236

@@ -877,10 +877,9 @@ static void tegra_admaif_remove(struct platform_device *pdev)
877877
}
878878

879879
static const struct dev_pm_ops tegra_admaif_pm_ops = {
880-
SET_RUNTIME_PM_OPS(tegra_admaif_runtime_suspend,
881-
tegra_admaif_runtime_resume, NULL)
882-
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
883-
pm_runtime_force_resume)
880+
RUNTIME_PM_OPS(tegra_admaif_runtime_suspend,
881+
tegra_admaif_runtime_resume, NULL)
882+
SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
884883
};
885884

886885
static struct platform_driver tegra_admaif_driver = {
@@ -889,7 +888,7 @@ static struct platform_driver tegra_admaif_driver = {
889888
.driver = {
890889
.name = "tegra210-admaif",
891890
.of_match_table = tegra_admaif_of_match,
892-
.pm = &tegra_admaif_pm_ops,
891+
.pm = pm_ptr(&tegra_admaif_pm_ops),
893892
},
894893
};
895894
module_platform_driver(tegra_admaif_driver);

sound/soc/tegra/tegra210_adx.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static int tegra210_adx_startup(struct snd_pcm_substream *substream,
8484
return 0;
8585
}
8686

87-
static int __maybe_unused tegra210_adx_runtime_suspend(struct device *dev)
87+
static int tegra210_adx_runtime_suspend(struct device *dev)
8888
{
8989
struct tegra210_adx *adx = dev_get_drvdata(dev);
9090

@@ -94,7 +94,7 @@ static int __maybe_unused tegra210_adx_runtime_suspend(struct device *dev)
9494
return 0;
9595
}
9696

97-
static int __maybe_unused tegra210_adx_runtime_resume(struct device *dev)
97+
static int tegra210_adx_runtime_resume(struct device *dev)
9898
{
9999
struct tegra210_adx *adx = dev_get_drvdata(dev);
100100

@@ -524,17 +524,16 @@ static void tegra210_adx_platform_remove(struct platform_device *pdev)
524524
}
525525

526526
static const struct dev_pm_ops tegra210_adx_pm_ops = {
527-
SET_RUNTIME_PM_OPS(tegra210_adx_runtime_suspend,
528-
tegra210_adx_runtime_resume, NULL)
529-
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
530-
pm_runtime_force_resume)
527+
RUNTIME_PM_OPS(tegra210_adx_runtime_suspend,
528+
tegra210_adx_runtime_resume, NULL)
529+
SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
531530
};
532531

533532
static struct platform_driver tegra210_adx_driver = {
534533
.driver = {
535534
.name = "tegra210-adx",
536535
.of_match_table = tegra210_adx_of_match,
537-
.pm = &tegra210_adx_pm_ops,
536+
.pm = pm_ptr(&tegra210_adx_pm_ops),
538537
},
539538
.probe = tegra210_adx_platform_probe,
540539
.remove = tegra210_adx_platform_remove,

sound/soc/tegra/tegra210_ahub.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,7 @@ static const struct of_device_id tegra_ahub_of_match[] = {
13191319
};
13201320
MODULE_DEVICE_TABLE(of, tegra_ahub_of_match);
13211321

1322-
static int __maybe_unused tegra_ahub_runtime_suspend(struct device *dev)
1322+
static int tegra_ahub_runtime_suspend(struct device *dev)
13231323
{
13241324
struct tegra_ahub *ahub = dev_get_drvdata(dev);
13251325

@@ -1331,7 +1331,7 @@ static int __maybe_unused tegra_ahub_runtime_suspend(struct device *dev)
13311331
return 0;
13321332
}
13331333

1334-
static int __maybe_unused tegra_ahub_runtime_resume(struct device *dev)
1334+
static int tegra_ahub_runtime_resume(struct device *dev)
13351335
{
13361336
struct tegra_ahub *ahub = dev_get_drvdata(dev);
13371337
int err;
@@ -1408,10 +1408,9 @@ static void tegra_ahub_remove(struct platform_device *pdev)
14081408
}
14091409

14101410
static const struct dev_pm_ops tegra_ahub_pm_ops = {
1411-
SET_RUNTIME_PM_OPS(tegra_ahub_runtime_suspend,
1412-
tegra_ahub_runtime_resume, NULL)
1413-
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
1414-
pm_runtime_force_resume)
1411+
RUNTIME_PM_OPS(tegra_ahub_runtime_suspend,
1412+
tegra_ahub_runtime_resume, NULL)
1413+
SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
14151414
};
14161415

14171416
static struct platform_driver tegra_ahub_driver = {
@@ -1420,7 +1419,7 @@ static struct platform_driver tegra_ahub_driver = {
14201419
.driver = {
14211420
.name = "tegra210-ahub",
14221421
.of_match_table = tegra_ahub_of_match,
1423-
.pm = &tegra_ahub_pm_ops,
1422+
.pm = pm_ptr(&tegra_ahub_pm_ops),
14241423
},
14251424
};
14261425
module_platform_driver(tegra_ahub_driver);

sound/soc/tegra/tegra210_amx.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static int tegra210_amx_startup(struct snd_pcm_substream *substream,
9898
return 0;
9999
}
100100

101-
static int __maybe_unused tegra210_amx_runtime_suspend(struct device *dev)
101+
static int tegra210_amx_runtime_suspend(struct device *dev)
102102
{
103103
struct tegra210_amx *amx = dev_get_drvdata(dev);
104104

@@ -108,7 +108,7 @@ static int __maybe_unused tegra210_amx_runtime_suspend(struct device *dev)
108108
return 0;
109109
}
110110

111-
static int __maybe_unused tegra210_amx_runtime_resume(struct device *dev)
111+
static int tegra210_amx_runtime_resume(struct device *dev)
112112
{
113113
struct tegra210_amx *amx = dev_get_drvdata(dev);
114114

@@ -581,17 +581,16 @@ static void tegra210_amx_platform_remove(struct platform_device *pdev)
581581
}
582582

583583
static const struct dev_pm_ops tegra210_amx_pm_ops = {
584-
SET_RUNTIME_PM_OPS(tegra210_amx_runtime_suspend,
585-
tegra210_amx_runtime_resume, NULL)
586-
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
587-
pm_runtime_force_resume)
584+
RUNTIME_PM_OPS(tegra210_amx_runtime_suspend,
585+
tegra210_amx_runtime_resume, NULL)
586+
SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
588587
};
589588

590589
static struct platform_driver tegra210_amx_driver = {
591590
.driver = {
592591
.name = "tegra210-amx",
593592
.of_match_table = tegra210_amx_of_match,
594-
.pm = &tegra210_amx_pm_ops,
593+
.pm = pm_ptr(&tegra210_amx_pm_ops),
595594
},
596595
.probe = tegra210_amx_platform_probe,
597596
.remove = tegra210_amx_platform_remove,

sound/soc/tegra/tegra210_dmic.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static const struct reg_default tegra210_dmic_reg_defaults[] = {
4040
{ TEGRA210_DMIC_LP_BIQUAD_1_COEF_4, 0x0 },
4141
};
4242

43-
static int __maybe_unused tegra210_dmic_runtime_suspend(struct device *dev)
43+
static int tegra210_dmic_runtime_suspend(struct device *dev)
4444
{
4545
struct tegra210_dmic *dmic = dev_get_drvdata(dev);
4646

@@ -52,7 +52,7 @@ static int __maybe_unused tegra210_dmic_runtime_suspend(struct device *dev)
5252
return 0;
5353
}
5454

55-
static int __maybe_unused tegra210_dmic_runtime_resume(struct device *dev)
55+
static int tegra210_dmic_runtime_resume(struct device *dev)
5656
{
5757
struct tegra210_dmic *dmic = dev_get_drvdata(dev);
5858
int err;
@@ -543,10 +543,9 @@ static void tegra210_dmic_remove(struct platform_device *pdev)
543543
}
544544

545545
static const struct dev_pm_ops tegra210_dmic_pm_ops = {
546-
SET_RUNTIME_PM_OPS(tegra210_dmic_runtime_suspend,
547-
tegra210_dmic_runtime_resume, NULL)
548-
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
549-
pm_runtime_force_resume)
546+
RUNTIME_PM_OPS(tegra210_dmic_runtime_suspend,
547+
tegra210_dmic_runtime_resume, NULL)
548+
SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
550549
};
551550

552551
static const struct of_device_id tegra210_dmic_of_match[] = {
@@ -559,7 +558,7 @@ static struct platform_driver tegra210_dmic_driver = {
559558
.driver = {
560559
.name = "tegra210-dmic",
561560
.of_match_table = tegra210_dmic_of_match,
562-
.pm = &tegra210_dmic_pm_ops,
561+
.pm = pm_ptr(&tegra210_dmic_pm_ops),
563562
},
564563
.probe = tegra210_dmic_probe,
565564
.remove = tegra210_dmic_remove,

sound/soc/tegra/tegra210_i2s.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static int tegra210_i2s_init(struct snd_soc_dapm_widget *w,
166166
return tegra210_i2s_sw_reset(compnt, stream);
167167
}
168168

169-
static int __maybe_unused tegra210_i2s_runtime_suspend(struct device *dev)
169+
static int tegra210_i2s_runtime_suspend(struct device *dev)
170170
{
171171
struct tegra210_i2s *i2s = dev_get_drvdata(dev);
172172

@@ -178,7 +178,7 @@ static int __maybe_unused tegra210_i2s_runtime_suspend(struct device *dev)
178178
return 0;
179179
}
180180

181-
static int __maybe_unused tegra210_i2s_runtime_resume(struct device *dev)
181+
static int tegra210_i2s_runtime_resume(struct device *dev)
182182
{
183183
struct tegra210_i2s *i2s = dev_get_drvdata(dev);
184184
int err;
@@ -1010,10 +1010,9 @@ static void tegra210_i2s_remove(struct platform_device *pdev)
10101010
}
10111011

10121012
static const struct dev_pm_ops tegra210_i2s_pm_ops = {
1013-
SET_RUNTIME_PM_OPS(tegra210_i2s_runtime_suspend,
1014-
tegra210_i2s_runtime_resume, NULL)
1015-
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
1016-
pm_runtime_force_resume)
1013+
RUNTIME_PM_OPS(tegra210_i2s_runtime_suspend,
1014+
tegra210_i2s_runtime_resume, NULL)
1015+
SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
10171016
};
10181017

10191018
static const struct of_device_id tegra210_i2s_of_match[] = {
@@ -1026,7 +1025,7 @@ static struct platform_driver tegra210_i2s_driver = {
10261025
.driver = {
10271026
.name = "tegra210-i2s",
10281027
.of_match_table = tegra210_i2s_of_match,
1029-
.pm = &tegra210_i2s_pm_ops,
1028+
.pm = pm_ptr(&tegra210_i2s_pm_ops),
10301029
},
10311030
.probe = tegra210_i2s_probe,
10321031
.remove = tegra210_i2s_remove,

sound/soc/tegra/tegra210_mixer.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static const struct tegra210_mixer_gain_params gain_params = {
7373
{ 0, 0, 0x400, 0x8000000 },
7474
};
7575

76-
static int __maybe_unused tegra210_mixer_runtime_suspend(struct device *dev)
76+
static int tegra210_mixer_runtime_suspend(struct device *dev)
7777
{
7878
struct tegra210_mixer *mixer = dev_get_drvdata(dev);
7979

@@ -83,7 +83,7 @@ static int __maybe_unused tegra210_mixer_runtime_suspend(struct device *dev)
8383
return 0;
8484
}
8585

86-
static int __maybe_unused tegra210_mixer_runtime_resume(struct device *dev)
86+
static int tegra210_mixer_runtime_resume(struct device *dev)
8787
{
8888
struct tegra210_mixer *mixer = dev_get_drvdata(dev);
8989

@@ -666,17 +666,16 @@ static void tegra210_mixer_platform_remove(struct platform_device *pdev)
666666
}
667667

668668
static const struct dev_pm_ops tegra210_mixer_pm_ops = {
669-
SET_RUNTIME_PM_OPS(tegra210_mixer_runtime_suspend,
670-
tegra210_mixer_runtime_resume, NULL)
671-
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
672-
pm_runtime_force_resume)
669+
RUNTIME_PM_OPS(tegra210_mixer_runtime_suspend,
670+
tegra210_mixer_runtime_resume, NULL)
671+
SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
673672
};
674673

675674
static struct platform_driver tegra210_mixer_driver = {
676675
.driver = {
677676
.name = "tegra210_mixer",
678677
.of_match_table = tegra210_mixer_of_match,
679-
.pm = &tegra210_mixer_pm_ops,
678+
.pm = pm_ptr(&tegra210_mixer_pm_ops),
680679
},
681680
.probe = tegra210_mixer_platform_probe,
682681
.remove = tegra210_mixer_platform_remove,

sound/soc/tegra/tegra210_mvc.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static const struct tegra210_mvc_gain_params gain_params = {
4747
.duration_inv = 14316558,
4848
};
4949

50-
static int __maybe_unused tegra210_mvc_runtime_suspend(struct device *dev)
50+
static int tegra210_mvc_runtime_suspend(struct device *dev)
5151
{
5252
struct tegra210_mvc *mvc = dev_get_drvdata(dev);
5353

@@ -59,7 +59,7 @@ static int __maybe_unused tegra210_mvc_runtime_suspend(struct device *dev)
5959
return 0;
6060
}
6161

62-
static int __maybe_unused tegra210_mvc_runtime_resume(struct device *dev)
62+
static int tegra210_mvc_runtime_resume(struct device *dev)
6363
{
6464
struct tegra210_mvc *mvc = dev_get_drvdata(dev);
6565

@@ -758,17 +758,16 @@ static void tegra210_mvc_platform_remove(struct platform_device *pdev)
758758
}
759759

760760
static const struct dev_pm_ops tegra210_mvc_pm_ops = {
761-
SET_RUNTIME_PM_OPS(tegra210_mvc_runtime_suspend,
762-
tegra210_mvc_runtime_resume, NULL)
763-
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
764-
pm_runtime_force_resume)
761+
RUNTIME_PM_OPS(tegra210_mvc_runtime_suspend,
762+
tegra210_mvc_runtime_resume, NULL)
763+
SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
765764
};
766765

767766
static struct platform_driver tegra210_mvc_driver = {
768767
.driver = {
769768
.name = "tegra210-mvc",
770769
.of_match_table = tegra210_mvc_of_match,
771-
.pm = &tegra210_mvc_pm_ops,
770+
.pm = pm_ptr(&tegra210_mvc_pm_ops),
772771
},
773772
.probe = tegra210_mvc_platform_probe,
774773
.remove = tegra210_mvc_platform_remove,

sound/soc/tegra/tegra210_ope.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ static void tegra210_ope_remove(struct platform_device *pdev)
356356
pm_runtime_disable(&pdev->dev);
357357
}
358358

359-
static int __maybe_unused tegra210_ope_runtime_suspend(struct device *dev)
359+
static int tegra210_ope_runtime_suspend(struct device *dev)
360360
{
361361
struct tegra210_ope *ope = dev_get_drvdata(dev);
362362

@@ -374,7 +374,7 @@ static int __maybe_unused tegra210_ope_runtime_suspend(struct device *dev)
374374
return 0;
375375
}
376376

377-
static int __maybe_unused tegra210_ope_runtime_resume(struct device *dev)
377+
static int tegra210_ope_runtime_resume(struct device *dev)
378378
{
379379
struct tegra210_ope *ope = dev_get_drvdata(dev);
380380

@@ -393,10 +393,9 @@ static int __maybe_unused tegra210_ope_runtime_resume(struct device *dev)
393393
}
394394

395395
static const struct dev_pm_ops tegra210_ope_pm_ops = {
396-
SET_RUNTIME_PM_OPS(tegra210_ope_runtime_suspend,
397-
tegra210_ope_runtime_resume, NULL)
398-
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
399-
pm_runtime_force_resume)
396+
RUNTIME_PM_OPS(tegra210_ope_runtime_suspend,
397+
tegra210_ope_runtime_resume, NULL)
398+
SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
400399
};
401400

402401
static const struct of_device_id tegra210_ope_of_match[] = {
@@ -409,7 +408,7 @@ static struct platform_driver tegra210_ope_driver = {
409408
.driver = {
410409
.name = "tegra210-ope",
411410
.of_match_table = tegra210_ope_of_match,
412-
.pm = &tegra210_ope_pm_ops,
411+
.pm = pm_ptr(&tegra210_ope_pm_ops),
413412
},
414413
.probe = tegra210_ope_probe,
415414
.remove = tegra210_ope_remove,

0 commit comments

Comments
 (0)