Skip to content

Commit ebfbcfc

Browse files
committed
ASoC: Convert to modern PM macros
Merge series from Takashi Iwai <[email protected]>: This is a revised series of small and trivial patches to convert to the newer PM macros, e.g. from SET_RUNTIME_PM_OPS() to RUNTIME_PM_OPS(). The conversions are systematic, and we could reduce messy __maybe_unused and ifdefs with those changes. Merely code refactoring, and shouldn't change the actual driver behavior.
2 parents aaf08d7 + 15559cd commit ebfbcfc

File tree

167 files changed

+591
-764
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+591
-764
lines changed

sound/soc/amd/acp/acp-pci.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id
221221
return ret;
222222
};
223223

224-
static int __maybe_unused snd_acp_suspend(struct device *dev)
224+
static int snd_acp_suspend(struct device *dev)
225225
{
226226
struct acp_chip_info *chip;
227227
int ret;
@@ -233,7 +233,7 @@ static int __maybe_unused snd_acp_suspend(struct device *dev)
233233
return ret;
234234
}
235235

236-
static int __maybe_unused snd_acp_resume(struct device *dev)
236+
static int snd_acp_resume(struct device *dev)
237237
{
238238
struct acp_chip_info *chip;
239239
int ret;
@@ -251,8 +251,8 @@ static int __maybe_unused snd_acp_resume(struct device *dev)
251251
}
252252

253253
static const struct dev_pm_ops acp_pm_ops = {
254-
SET_RUNTIME_PM_OPS(snd_acp_suspend, snd_acp_resume, NULL)
255-
SET_SYSTEM_SLEEP_PM_OPS(snd_acp_suspend, snd_acp_resume)
254+
RUNTIME_PM_OPS(snd_acp_suspend, snd_acp_resume, NULL)
255+
SYSTEM_SLEEP_PM_OPS(snd_acp_suspend, snd_acp_resume)
256256
};
257257

258258
static void acp_pci_remove(struct pci_dev *pci)
@@ -289,7 +289,7 @@ static struct pci_driver snd_amd_acp_pci_driver = {
289289
.probe = acp_pci_probe,
290290
.remove = acp_pci_remove,
291291
.driver = {
292-
.pm = &acp_pm_ops,
292+
.pm = pm_ptr(&acp_pm_ops),
293293
},
294294
};
295295
module_pci_driver(snd_amd_acp_pci_driver);

sound/soc/amd/acp/acp-rembrandt.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static void rembrandt_audio_remove(struct platform_device *pdev)
197197
pm_runtime_disable(&pdev->dev);
198198
}
199199

200-
static int __maybe_unused rmb_pcm_resume(struct device *dev)
200+
static int rmb_pcm_resume(struct device *dev)
201201
{
202202
struct acp_chip_info *chip = dev_get_platdata(dev);
203203
struct acp_stream *stream;
@@ -227,15 +227,15 @@ static int __maybe_unused rmb_pcm_resume(struct device *dev)
227227
}
228228

229229
static const struct dev_pm_ops rmb_dma_pm_ops = {
230-
SET_SYSTEM_SLEEP_PM_OPS(NULL, rmb_pcm_resume)
230+
SYSTEM_SLEEP_PM_OPS(NULL, rmb_pcm_resume)
231231
};
232232

233233
static struct platform_driver rembrandt_driver = {
234234
.probe = rembrandt_audio_probe,
235235
.remove = rembrandt_audio_remove,
236236
.driver = {
237237
.name = "acp_asoc_rembrandt",
238-
.pm = &rmb_dma_pm_ops,
238+
.pm = pm_ptr(&rmb_dma_pm_ops),
239239
},
240240
};
241241

sound/soc/amd/acp/acp-renoir.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static void renoir_audio_remove(struct platform_device *pdev)
144144
acp_platform_unregister(dev);
145145
}
146146

147-
static int __maybe_unused rn_pcm_resume(struct device *dev)
147+
static int rn_pcm_resume(struct device *dev)
148148
{
149149
struct acp_chip_info *chip = dev_get_platdata(dev);
150150
struct acp_stream *stream;
@@ -171,15 +171,15 @@ static int __maybe_unused rn_pcm_resume(struct device *dev)
171171
}
172172

173173
static const struct dev_pm_ops rn_dma_pm_ops = {
174-
SET_SYSTEM_SLEEP_PM_OPS(NULL, rn_pcm_resume)
174+
SYSTEM_SLEEP_PM_OPS(NULL, rn_pcm_resume)
175175
};
176176

177177
static struct platform_driver renoir_driver = {
178178
.probe = renoir_audio_probe,
179179
.remove = renoir_audio_remove,
180180
.driver = {
181181
.name = "acp_asoc_renoir",
182-
.pm = &rn_dma_pm_ops,
182+
.pm = pm_ptr(&rn_dma_pm_ops),
183183
},
184184
};
185185

sound/soc/amd/acp/acp63.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ static void acp63_audio_remove(struct platform_device *pdev)
248248
pm_runtime_disable(&pdev->dev);
249249
}
250250

251-
static int __maybe_unused acp63_pcm_resume(struct device *dev)
251+
static int acp63_pcm_resume(struct device *dev)
252252
{
253253
struct acp_chip_info *chip = dev_get_platdata(dev);
254254
struct acp_stream *stream;
@@ -278,15 +278,15 @@ static int __maybe_unused acp63_pcm_resume(struct device *dev)
278278
}
279279

280280
static const struct dev_pm_ops acp63_dma_pm_ops = {
281-
SET_SYSTEM_SLEEP_PM_OPS(NULL, acp63_pcm_resume)
281+
SYSTEM_SLEEP_PM_OPS(NULL, acp63_pcm_resume)
282282
};
283283

284284
static struct platform_driver acp63_driver = {
285285
.probe = acp63_audio_probe,
286286
.remove = acp63_audio_remove,
287287
.driver = {
288288
.name = "acp_asoc_acp63",
289-
.pm = &acp63_dma_pm_ops,
289+
.pm = pm_ptr(&acp63_dma_pm_ops),
290290
},
291291
};
292292

sound/soc/amd/acp/acp70.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static void acp_acp70_audio_remove(struct platform_device *pdev)
180180
pm_runtime_disable(&pdev->dev);
181181
}
182182

183-
static int __maybe_unused acp70_pcm_resume(struct device *dev)
183+
static int acp70_pcm_resume(struct device *dev)
184184
{
185185
struct acp_chip_info *chip = dev_get_platdata(dev);
186186
struct acp_stream *stream;
@@ -207,15 +207,15 @@ static int __maybe_unused acp70_pcm_resume(struct device *dev)
207207
}
208208

209209
static const struct dev_pm_ops acp70_dma_pm_ops = {
210-
SET_SYSTEM_SLEEP_PM_OPS(NULL, acp70_pcm_resume)
210+
SYSTEM_SLEEP_PM_OPS(NULL, acp70_pcm_resume)
211211
};
212212

213213
static struct platform_driver acp70_driver = {
214214
.probe = acp_acp70_audio_probe,
215215
.remove = acp_acp70_audio_remove,
216216
.driver = {
217217
.name = "acp_asoc_acp70",
218-
.pm = &acp70_dma_pm_ops,
218+
.pm = pm_ptr(&acp70_dma_pm_ops),
219219
},
220220
};
221221

sound/soc/amd/ps/pci-ps.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -668,24 +668,24 @@ static int snd_acp63_probe(struct pci_dev *pci,
668668
return ret;
669669
}
670670

671-
static int __maybe_unused snd_acp_suspend(struct device *dev)
671+
static int snd_acp_suspend(struct device *dev)
672672
{
673673
return acp_hw_suspend(dev);
674674
}
675675

676-
static int __maybe_unused snd_acp_runtime_resume(struct device *dev)
676+
static int snd_acp_runtime_resume(struct device *dev)
677677
{
678678
return acp_hw_runtime_resume(dev);
679679
}
680680

681-
static int __maybe_unused snd_acp_resume(struct device *dev)
681+
static int snd_acp_resume(struct device *dev)
682682
{
683683
return acp_hw_resume(dev);
684684
}
685685

686686
static const struct dev_pm_ops acp63_pm_ops = {
687-
SET_RUNTIME_PM_OPS(snd_acp_suspend, snd_acp_runtime_resume, NULL)
688-
SET_SYSTEM_SLEEP_PM_OPS(snd_acp_suspend, snd_acp_resume)
687+
RUNTIME_PM_OPS(snd_acp_suspend, snd_acp_runtime_resume, NULL)
688+
SYSTEM_SLEEP_PM_OPS(snd_acp_suspend, snd_acp_resume)
689689
};
690690

691691
static void snd_acp63_remove(struct pci_dev *pci)
@@ -727,7 +727,7 @@ static struct pci_driver ps_acp63_driver = {
727727
.probe = snd_acp63_probe,
728728
.remove = snd_acp63_remove,
729729
.driver = {
730-
.pm = &acp63_pm_ops,
730+
.pm = pm_ptr(&acp63_pm_ops),
731731
}
732732
};
733733

sound/soc/amd/ps/ps-pdm-dma.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ static void acp63_pdm_audio_remove(struct platform_device *pdev)
402402
pm_runtime_disable(&pdev->dev);
403403
}
404404

405-
static int __maybe_unused acp63_pdm_resume(struct device *dev)
405+
static int acp63_pdm_resume(struct device *dev)
406406
{
407407
struct pdm_dev_data *adata;
408408
struct snd_pcm_runtime *runtime;
@@ -423,7 +423,7 @@ static int __maybe_unused acp63_pdm_resume(struct device *dev)
423423
return 0;
424424
}
425425

426-
static int __maybe_unused acp63_pdm_suspend(struct device *dev)
426+
static int acp63_pdm_suspend(struct device *dev)
427427
{
428428
struct pdm_dev_data *adata;
429429

@@ -432,7 +432,7 @@ static int __maybe_unused acp63_pdm_suspend(struct device *dev)
432432
return 0;
433433
}
434434

435-
static int __maybe_unused acp63_pdm_runtime_resume(struct device *dev)
435+
static int acp63_pdm_runtime_resume(struct device *dev)
436436
{
437437
struct pdm_dev_data *adata;
438438

@@ -442,16 +442,16 @@ static int __maybe_unused acp63_pdm_runtime_resume(struct device *dev)
442442
}
443443

444444
static const struct dev_pm_ops acp63_pdm_pm_ops = {
445-
SET_RUNTIME_PM_OPS(acp63_pdm_suspend, acp63_pdm_runtime_resume, NULL)
446-
SET_SYSTEM_SLEEP_PM_OPS(acp63_pdm_suspend, acp63_pdm_resume)
445+
RUNTIME_PM_OPS(acp63_pdm_suspend, acp63_pdm_runtime_resume, NULL)
446+
SYSTEM_SLEEP_PM_OPS(acp63_pdm_suspend, acp63_pdm_resume)
447447
};
448448

449449
static struct platform_driver acp63_pdm_dma_driver = {
450450
.probe = acp63_pdm_audio_probe,
451451
.remove = acp63_pdm_audio_remove,
452452
.driver = {
453453
.name = "acp_ps_pdm_dma",
454-
.pm = &acp63_pdm_pm_ops,
454+
.pm = pm_ptr(&acp63_pdm_pm_ops),
455455
},
456456
};
457457

sound/soc/amd/ps/ps-sdw-dma.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ static int acp70_restore_sdw_dma_config(struct sdw_dma_dev_data *sdw_data)
767767
return 0;
768768
}
769769

770-
static int __maybe_unused acp63_sdw_pcm_resume(struct device *dev)
770+
static int acp63_sdw_pcm_resume(struct device *dev)
771771
{
772772
struct sdw_dma_dev_data *sdw_data;
773773

@@ -779,15 +779,15 @@ static int __maybe_unused acp63_sdw_pcm_resume(struct device *dev)
779779
}
780780

781781
static const struct dev_pm_ops acp63_pm_ops = {
782-
SET_SYSTEM_SLEEP_PM_OPS(NULL, acp63_sdw_pcm_resume)
782+
SYSTEM_SLEEP_PM_OPS(NULL, acp63_sdw_pcm_resume)
783783
};
784784

785785
static struct platform_driver acp63_sdw_dma_driver = {
786786
.probe = acp63_sdw_platform_probe,
787787
.remove = acp63_sdw_platform_remove,
788788
.driver = {
789789
.name = "amd_ps_sdw_dma",
790-
.pm = &acp63_pm_ops,
790+
.pm = pm_ptr(&acp63_pm_ops),
791791
},
792792
};
793793

sound/soc/amd/rpl/rpl-pci-acp6x.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static int snd_rpl_probe(struct pci_dev *pci,
159159
return ret;
160160
}
161161

162-
static int __maybe_unused snd_rpl_suspend(struct device *dev)
162+
static int snd_rpl_suspend(struct device *dev)
163163
{
164164
struct rpl_dev_data *adata;
165165
int ret;
@@ -171,7 +171,7 @@ static int __maybe_unused snd_rpl_suspend(struct device *dev)
171171
return ret;
172172
}
173173

174-
static int __maybe_unused snd_rpl_resume(struct device *dev)
174+
static int snd_rpl_resume(struct device *dev)
175175
{
176176
struct rpl_dev_data *adata;
177177
int ret;
@@ -184,8 +184,8 @@ static int __maybe_unused snd_rpl_resume(struct device *dev)
184184
}
185185

186186
static const struct dev_pm_ops rpl_pm = {
187-
SET_RUNTIME_PM_OPS(snd_rpl_suspend, snd_rpl_resume, NULL)
188-
SET_SYSTEM_SLEEP_PM_OPS(snd_rpl_suspend, snd_rpl_resume)
187+
RUNTIME_PM_OPS(snd_rpl_suspend, snd_rpl_resume, NULL)
188+
SYSTEM_SLEEP_PM_OPS(snd_rpl_suspend, snd_rpl_resume)
189189
};
190190

191191
static void snd_rpl_remove(struct pci_dev *pci)
@@ -217,7 +217,7 @@ static struct pci_driver rpl_acp6x_driver = {
217217
.probe = snd_rpl_probe,
218218
.remove = snd_rpl_remove,
219219
.driver = {
220-
.pm = &rpl_pm,
220+
.pm = pm_ptr(&rpl_pm),
221221
}
222222
};
223223

sound/soc/amd/vangogh/acp5x-pcm-dma.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ static void acp5x_audio_remove(struct platform_device *pdev)
420420
pm_runtime_disable(&pdev->dev);
421421
}
422422

423-
static int __maybe_unused acp5x_pcm_resume(struct device *dev)
423+
static int acp5x_pcm_resume(struct device *dev)
424424
{
425425
struct i2s_dev_data *adata;
426426
struct i2s_stream_instance *rtd;
@@ -473,7 +473,7 @@ static int __maybe_unused acp5x_pcm_resume(struct device *dev)
473473
return 0;
474474
}
475475

476-
static int __maybe_unused acp5x_pcm_suspend(struct device *dev)
476+
static int acp5x_pcm_suspend(struct device *dev)
477477
{
478478
struct i2s_dev_data *adata;
479479

@@ -482,7 +482,7 @@ static int __maybe_unused acp5x_pcm_suspend(struct device *dev)
482482
return 0;
483483
}
484484

485-
static int __maybe_unused acp5x_pcm_runtime_resume(struct device *dev)
485+
static int acp5x_pcm_runtime_resume(struct device *dev)
486486
{
487487
struct i2s_dev_data *adata;
488488

@@ -492,9 +492,8 @@ static int __maybe_unused acp5x_pcm_runtime_resume(struct device *dev)
492492
}
493493

494494
static const struct dev_pm_ops acp5x_pm_ops = {
495-
SET_RUNTIME_PM_OPS(acp5x_pcm_suspend,
496-
acp5x_pcm_runtime_resume, NULL)
497-
SET_SYSTEM_SLEEP_PM_OPS(acp5x_pcm_suspend, acp5x_pcm_resume)
495+
RUNTIME_PM_OPS(acp5x_pcm_suspend, acp5x_pcm_runtime_resume, NULL)
496+
SYSTEM_SLEEP_PM_OPS(acp5x_pcm_suspend, acp5x_pcm_resume)
498497
};
499498

500499
static struct platform_driver acp5x_dma_driver = {

0 commit comments

Comments
 (0)