mirror of
https://github.com/torvalds/linux.git
synced 2026-05-29 17:43:52 +02:00
ASoC: ak5558: 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. Signed-off-by: Takashi Iwai <tiwai@suse.de> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://patch.msgid.link/20250317095603.20073-5-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
9f9c8e9064
commit
5ef209dcdc
|
|
@ -342,7 +342,7 @@ static void ak5558_remove(struct snd_soc_component *component)
|
|||
ak5558_reset(ak5558, true);
|
||||
}
|
||||
|
||||
static int __maybe_unused ak5558_runtime_suspend(struct device *dev)
|
||||
static int ak5558_runtime_suspend(struct device *dev)
|
||||
{
|
||||
struct ak5558_priv *ak5558 = dev_get_drvdata(dev);
|
||||
|
||||
|
|
@ -354,7 +354,7 @@ static int __maybe_unused ak5558_runtime_suspend(struct device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused ak5558_runtime_resume(struct device *dev)
|
||||
static int ak5558_runtime_resume(struct device *dev)
|
||||
{
|
||||
struct ak5558_priv *ak5558 = dev_get_drvdata(dev);
|
||||
int ret;
|
||||
|
|
@ -376,9 +376,8 @@ static int __maybe_unused ak5558_runtime_resume(struct device *dev)
|
|||
}
|
||||
|
||||
static const struct dev_pm_ops ak5558_pm = {
|
||||
SET_RUNTIME_PM_OPS(ak5558_runtime_suspend, ak5558_runtime_resume, NULL)
|
||||
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
|
||||
pm_runtime_force_resume)
|
||||
RUNTIME_PM_OPS(ak5558_runtime_suspend, ak5558_runtime_resume, NULL)
|
||||
SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
|
||||
};
|
||||
|
||||
static const struct snd_soc_component_driver soc_codec_dev_ak5558 = {
|
||||
|
|
@ -495,7 +494,7 @@ static struct i2c_driver ak5558_i2c_driver = {
|
|||
.driver = {
|
||||
.name = "ak5558",
|
||||
.of_match_table = of_match_ptr(ak5558_i2c_dt_ids),
|
||||
.pm = &ak5558_pm,
|
||||
.pm = pm_ptr(&ak5558_pm),
|
||||
},
|
||||
.probe = ak5558_i2c_probe,
|
||||
.remove = ak5558_i2c_remove,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user