Skip to content

Commit 3954382

Browse files
committed
ALSA: ac97: Convert to RUNTIME_PM_OPS() macro
Use a newer RUNTIME_PM_OPS() macro instead of SET_RUNTIME_PM_OPS() together with pm_ptr(), which makes CONFIG_PM ifdefs superfluous. This optimizes slightly when CONFIG_PM is disabled, too. Signed-off-by: Takashi Iwai <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 520a563 commit 3954382

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

sound/ac97/bus.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,6 @@ void snd_ac97_controller_unregister(struct ac97_controller *ac97_ctrl)
387387
}
388388
EXPORT_SYMBOL_GPL(snd_ac97_controller_unregister);
389389

390-
#ifdef CONFIG_PM
391390
static int ac97_pm_runtime_suspend(struct device *dev)
392391
{
393392
struct ac97_codec_device *codec = to_ac97_device(dev);
@@ -419,7 +418,6 @@ static int ac97_pm_runtime_resume(struct device *dev)
419418

420419
return pm_generic_runtime_resume(dev);
421420
}
422-
#endif /* CONFIG_PM */
423421

424422
static const struct dev_pm_ops ac97_pm = {
425423
.suspend = pm_generic_suspend,
@@ -428,10 +426,7 @@ static const struct dev_pm_ops ac97_pm = {
428426
.thaw = pm_generic_thaw,
429427
.poweroff = pm_generic_poweroff,
430428
.restore = pm_generic_restore,
431-
SET_RUNTIME_PM_OPS(
432-
ac97_pm_runtime_suspend,
433-
ac97_pm_runtime_resume,
434-
NULL)
429+
RUNTIME_PM_OPS(ac97_pm_runtime_suspend, ac97_pm_runtime_resume, NULL)
435430
};
436431

437432
static int ac97_get_enable_clk(struct ac97_codec_device *adev)
@@ -535,7 +530,7 @@ const struct bus_type ac97_bus_type = {
535530
.name = "ac97bus",
536531
.dev_groups = ac97_dev_groups,
537532
.match = ac97_bus_match,
538-
.pm = &ac97_pm,
533+
.pm = pm_ptr(&ac97_pm),
539534
.probe = ac97_bus_probe,
540535
.remove = ac97_bus_remove,
541536
};

0 commit comments

Comments
 (0)