mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
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 <tiwai@suse.de> Link: https://patch.msgid.link/20250313170731.26943-2-tiwai@suse.de
This commit is contained in:
parent
520a563b9a
commit
3954382bb5
@ -387,7 +387,6 @@ void snd_ac97_controller_unregister(struct ac97_controller *ac97_ctrl)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(snd_ac97_controller_unregister);
|
EXPORT_SYMBOL_GPL(snd_ac97_controller_unregister);
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
|
||||||
static int ac97_pm_runtime_suspend(struct device *dev)
|
static int ac97_pm_runtime_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct ac97_codec_device *codec = to_ac97_device(dev);
|
struct ac97_codec_device *codec = to_ac97_device(dev);
|
||||||
@ -419,7 +418,6 @@ static int ac97_pm_runtime_resume(struct device *dev)
|
|||||||
|
|
||||||
return pm_generic_runtime_resume(dev);
|
return pm_generic_runtime_resume(dev);
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_PM */
|
|
||||||
|
|
||||||
static const struct dev_pm_ops ac97_pm = {
|
static const struct dev_pm_ops ac97_pm = {
|
||||||
.suspend = pm_generic_suspend,
|
.suspend = pm_generic_suspend,
|
||||||
@ -428,10 +426,7 @@ static const struct dev_pm_ops ac97_pm = {
|
|||||||
.thaw = pm_generic_thaw,
|
.thaw = pm_generic_thaw,
|
||||||
.poweroff = pm_generic_poweroff,
|
.poweroff = pm_generic_poweroff,
|
||||||
.restore = pm_generic_restore,
|
.restore = pm_generic_restore,
|
||||||
SET_RUNTIME_PM_OPS(
|
RUNTIME_PM_OPS(ac97_pm_runtime_suspend, ac97_pm_runtime_resume, NULL)
|
||||||
ac97_pm_runtime_suspend,
|
|
||||||
ac97_pm_runtime_resume,
|
|
||||||
NULL)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static int ac97_get_enable_clk(struct ac97_codec_device *adev)
|
static int ac97_get_enable_clk(struct ac97_codec_device *adev)
|
||||||
@ -535,7 +530,7 @@ const struct bus_type ac97_bus_type = {
|
|||||||
.name = "ac97bus",
|
.name = "ac97bus",
|
||||||
.dev_groups = ac97_dev_groups,
|
.dev_groups = ac97_dev_groups,
|
||||||
.match = ac97_bus_match,
|
.match = ac97_bus_match,
|
||||||
.pm = &ac97_pm,
|
.pm = pm_ptr(&ac97_pm),
|
||||||
.probe = ac97_bus_probe,
|
.probe = ac97_bus_probe,
|
||||||
.remove = ac97_bus_remove,
|
.remove = ac97_bus_remove,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user