Skip to content

Commit 46dd1b0

Browse files
tiwaigregkh
authored andcommitted
ASoC: ak4458: Convert to RUNTIME_PM_OPS() & co
commit 9f9c8e9 upstream. 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 and CONFIG_PM ifdefs. 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-4-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a093803 commit 46dd1b0

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

sound/soc/codecs/ak4458.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -639,8 +639,7 @@ static void ak4458_reset(struct ak4458_priv *ak4458, bool active)
639639
}
640640
}
641641

642-
#ifdef CONFIG_PM
643-
static int __maybe_unused ak4458_runtime_suspend(struct device *dev)
642+
static int ak4458_runtime_suspend(struct device *dev)
644643
{
645644
struct ak4458_priv *ak4458 = dev_get_drvdata(dev);
646645

@@ -656,7 +655,7 @@ static int __maybe_unused ak4458_runtime_suspend(struct device *dev)
656655
return 0;
657656
}
658657

659-
static int __maybe_unused ak4458_runtime_resume(struct device *dev)
658+
static int ak4458_runtime_resume(struct device *dev)
660659
{
661660
struct ak4458_priv *ak4458 = dev_get_drvdata(dev);
662661
int ret;
@@ -686,7 +685,6 @@ static int __maybe_unused ak4458_runtime_resume(struct device *dev)
686685
regulator_bulk_disable(ARRAY_SIZE(ak4458->supplies), ak4458->supplies);
687686
return ret;
688687
}
689-
#endif /* CONFIG_PM */
690688

691689
static const struct snd_soc_component_driver soc_codec_dev_ak4458 = {
692690
.controls = ak4458_snd_controls,
@@ -735,9 +733,8 @@ static const struct ak4458_drvdata ak4497_drvdata = {
735733
};
736734

737735
static const struct dev_pm_ops ak4458_pm = {
738-
SET_RUNTIME_PM_OPS(ak4458_runtime_suspend, ak4458_runtime_resume, NULL)
739-
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
740-
pm_runtime_force_resume)
736+
RUNTIME_PM_OPS(ak4458_runtime_suspend, ak4458_runtime_resume, NULL)
737+
SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
741738
};
742739

743740
static int ak4458_i2c_probe(struct i2c_client *i2c)
@@ -809,7 +806,7 @@ MODULE_DEVICE_TABLE(of, ak4458_of_match);
809806
static struct i2c_driver ak4458_i2c_driver = {
810807
.driver = {
811808
.name = "ak4458",
812-
.pm = &ak4458_pm,
809+
.pm = pm_ptr(&ak4458_pm),
813810
.of_match_table = ak4458_of_match,
814811
},
815812
.probe = ak4458_i2c_probe,

0 commit comments

Comments
 (0)